First of all, very interesting and useful library! I currently use LÖVE for an app prototype that is in need of an ECS, and in the end decided on tiny-ecs.
However, I'm wondering how I can toggle a System so that it is enabled/disabled depending on its current status.
Consider the following: If I press "P", the screen should get dark and "Pause" should appear. When I press "P" again, the screen should become normal again.
I got it working with something like this:
Code: Select all
function love.load()
WORLD = tiny.world()
pauseDrawSys = WORLD:addSystem(PauseDrawSystem)
pauseDrawSys.active = false
end
[...]
function love.keypressed(key)
if key == "p" then
pauseDrawSys.active = not pauseDrawSys.active
end
end
So far, I haven't found anything about toggling in the API documentation. Do you think there is another way to achieve this?