In-Game SpriteSheet Buttons, Good way?

Hi everyone.
I am building a simple spawner system, and spawner (button), can have 5,4,3,2,1,0 items, inside of this buttons, and it should update every time that i create a object or remove this object, and i am learning about the best ways to do that, it is simple, i click on the button and it create a object, and then i click on the object and it is removed. i am using sprite sheet to show the spawner, i am coding some like it:

local count = 0  
spawner.currentFrame = count  
  
-- When i create the object it increase the count 1 value (count =count +1) and when,  
--i kill the object the count decrease one value (count = count -1), i use widget buttons on all other  
 --buttons on my game, but on this part, it will be a lot of button if a create some spawners, using sprite   
--sheets dont have problems? on simulator everything is good, but i really dont know on the real   
--device, and the game cant crash or have bad coding :)  

Thanks [import]uid: 26056 topic_id: 22822 reply_id: 322822[/import]

So your concern is how it performs on device, is that it? I think this is a fine way of doing things but obviously you should be testing on device anyway :slight_smile: [import]uid: 52491 topic_id: 22822 reply_id: 91211[/import]

Yeh it is, performance and coding is very very important for me, the game cant crash or have problems, i know that on software it is impossible to say that the code is 100% perfect and will not crash, but it is really important to guarantee the best performance and coding practise as possible [import]uid: 26056 topic_id: 22822 reply_id: 91248[/import]

Spritesheets are fine memory wise (the best way to go) and the sprite library is undergoing an update at present to further increase performance and memory usage. [import]uid: 84637 topic_id: 22822 reply_id: 91251[/import]

Really nice :slight_smile:
Thank you very much danny for the answers, it is good to know :slight_smile: [import]uid: 26056 topic_id: 22822 reply_id: 91256[/import]