Skip to content
Discussion options

You must be logged in to vote

@YBStolker Great question!

So, everytime the cursor moves it's killing an actor and creating a new one, which to me doesn't feel right, but I haven't made a lot of games so maybe that's the way to do it.

I'd say your intuition is right on. Creating an Actor every time the move event fires is going to create a lot of actors that will need to be cleaned up. Try creating 1 Selection at the beginning of the game (or in the Scene.onInitialize) and resizing it to match instead. You can adjust the isVisible and the graphics.current.width and height of the default rectangle.

So my question is, is there a better way to do this? Is there a way to resize the selection object instead of killing it…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@YBStolker
Comment options

@eonarheim
Comment options

Answer selected by YBStolker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants