It looks like you're new here. If you want to get involved, click one of these buttons!
local texture = Texture.new('coin.png') for i = 1,2000 do local coin = Bitmap.new(texture) coin:setPosition(-10000,-10000) -- try to get it out of viewable area, uneeded render stage:addChild(coin) end |
Comments
http://www.nightspade.com
What you need is an efficient manner of clipping sprites that are completely off screen (I suspect this is already implemented).
@Atilim - is it more efficient to call :setVisible(false) when you know a sprite is offscreen or doesn't it make any difference?
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
Likes: StoneGiantGames, lsouchet
http://www.nightspade.com
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
http://www.nightspade.com
Thanks
If you want to ignore the sprite update, then dont update it, if you don't want it to be drawn then use Sprite:setVisible(false)
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
I made a class like this:
Likes: MoKaLux
nice to see you back in the game
Better do something like that internally, and look also not for specific sprites, but the whole sprite trees to disable.
But on the other hand, if it is not needed then looping from sprites will only take resources, and probably with LuaJIT it won't matter much if it is done natively or not
Thanks for sharing