Better to have separate sprite sheets or one that contains all assets?

68 views
Skip to first unread message

Shaun Michael K. Stone

unread,
Sep 26, 2015, 1:39:36 PM9/26/15
to HaxeFlixel
My game contains everything in one spritesheet. Is it better to have separate spritesheets dependant on state?

Main Menu - MainMenu.PNG
Gameplay - Gameplay.PNG

When state is switched, does it dispose of the huge spritesheet and rebuild it?

Thanks. 

Gama11

unread,
Sep 27, 2015, 4:01:06 AM9/27/15
to HaxeFlixel
Flixel's graphics cache is indeed cleared on state switches (easy to see when typing "viewCache" into the console of the debugger).

Shaun Michael K. Stone

unread,
Sep 27, 2015, 4:09:47 AM9/27/15
to haxef...@googlegroups.com
I see. So in that case it is probably better to break them into separate smaller sheets instead of loading the big one in on every state switch!?

Gama11

unread,
Sep 27, 2015, 4:19:56 AM9/27/15
to HaxeFlixel
"Better" in what way? Better for memory consumption? Sure, but that's unlikely to be a big issue in the first place. Better for rendering performance? As long as everything needed is on the same spritesheet, that shouldn't really affect the amount of drawTiles calls.
Perhaps it's worth it if you're targeting mobile devices that have a low max texture resolution (2048x2048 or even 1024x1024) and you wouldn't be able to fit everything on that otherwise. Then again, you would need to split them up either way in that case.
Reply all
Reply to author
Forward
0 new messages