#178458 - DayTripperID - Sun Aug 23, 2015 1:04 am
Draw order of sprites is based on priorities 0 - 3, but I was wondering how the DS determines the draw order of sprites that have the same priority values? So if I have 3 sprites that are all priority 0, is there a way to know which one will be drawn first and which one will be drawn last?
#178459 - gauauu - Mon Aug 24, 2015 4:06 pm
I'm pretty sure they're drawn in order, from the first entry in OAM (with that priority) to the last. (or maybe it's last to first?) But it's based on the order they appear in OAM, so you often end up sorting them at some point.
#178464 - sverx - Tue Aug 25, 2015 3:58 pm
sprites with same priority gets drawn from first entry to last, on DS, which is different on how it works on GBA where sprites are drawn from first entry to last, regardless (seriously!) of their priority.
edit: I mean front to back of course
_________________
libXM7|NDS programming tutorial (Italiano)|Waimanu DS / GBA|A DS Homebrewer's Diary
#178471 - DayTripperID - Fri Aug 28, 2015 11:49 pm
Right on. I kinda figured it out through observation after I made this post. I was asking because I needed to be able to determine the draw order of sprites that shared the same priority to give me more flexibility. I wrote a method that sorts and swaps OAM id's according to pre defined game entity categories. So if I have something like a capital starship with rotating turrets I can squeeze them into the same priority.