Skip draw event for objects that are not on the screen #473
-
My game became a bit laggy because of the level size. Kaboom performs a draw event for each loaded object. How can I skip this action for those objects which are not on the screen but not destroy them? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
you could not draw them at first, and then use the function obj.use(sprite()) when the tiles should be drawn, and then, use obj.hidden = true to hide them. For this, you can assign a Tag and use every() in a onUpdate() |
Beta Was this translation helpful? Give feedback.
-
Now it's best to use the |
Beta Was this translation helpful? Give feedback.
you could not draw them at first, and then use the function obj.use(sprite()) when the tiles should be drawn, and then, use obj.hidden = true to hide them. For this, you can assign a Tag and use every() in a onUpdate()