Scrolling Game Development Kit Forum
SGDK Version 2 => Help, Errors, FAQ => Topic started by: eric22222 on 2014-04-09, 09:22:06 PM
-
Hey guys, anyone know of a good way to change the order spirtes within a layer are drawn? I'd like to keep my player on top, but it seems to draw from oldest to newest. Didn't find anything in the layer base file, but I may not be looking hard enough. Thanks!
-
Select a sprite in the map editor and you should see a "Priority" property. For sprites added at design time, that should control the order in which they are drawn. I believe the priority number is not available at runtime, only at design time. The effect it has it to determine the sort order in which the sprites design objects are generated into the code that adds sprites to the collections, and consequently, the order that they are drawn at run-time.
-
Ah, that may be my problem. I'm trying to keep my player on top of some sprites I generate on the fly. I can probably work around it with some layer shenanigans, though. Thanks for the help!