#6149 - krozen - Sun May 18, 2003 10:18 am
Hello,
I was just wondering if sprites have priority over drawing a regular pixel to the screen? If you had drawn them to screen, and the plotted pixels over them, would the pixel appear over them?
If not, how can that be done?
Cheers
#6162 - antysix - Sun May 18, 2003 6:03 pm
When a sprite has the same priority as a background, the sprite will be displayed on top of the background.
_________________
Currently playing: NGC: Metroid Prime
GBA: Golden Sun: The Lost Age
Currently developping: Project ~ [ Phail ]
#6167 - Daedro - Sun May 18, 2003 7:46 pm
antysix wrote: |
When a sprite has the same priority as a background, the sprite will be displayed on top of the background. |
Not always, in mode 4 the background appears over the sprite if you display it a certain way even without changing priority. I know this for sure, I spent a few hours getting mad becuase of this and trying to find the priority tags.
The priority can be changed, 0-3 and 3 being new and 0 being far but that can be changed too. The Pern Project has an RPG demo that uses it, they are BG_Priority(0) (background), and Priority(0) (sprite)
I think even a one pixel that is drawn is drawn into the background, but I have never tried it.
#6305 - krozen - Thu May 22, 2003 3:11 pm
How do you change the priority of a screen pixel in mode 4? Is there a simplier way of clipping the sprite other drawn than drawing them first, and then drawing over them?
#6317 - Daedro - Fri May 23, 2003 12:49 am
krozen wrote: |
How do you change the priority of a screen pixel in mode 4? Is there a simplier way of clipping the sprite other drawn than drawing them first, and then drawing over them? |
That last sentence is wierd.
You have to change the priority of the background to change the dot.
Like..
Code: |
REG_BG0CNT = BG_COLOR_256 | BG_PRIORITY(0) |
The 0 in the BG_PRIORITY is the top layer... this is currently the only way i know how to change the bg_priority, it could probably be done in other places accept REG_BG0CNT.. also bg2 would obviously be REG_BG2CNT.
I'll try and catch the next question.. I am still new to gba programming
#6319 - niltsair - Fri May 23, 2003 1:29 am
Can the priority really be changed in Mode 3,4,5? I would have thought it was a Mode 0,1,2 only thing.
#6320 - Daedro - Fri May 23, 2003 3:20 am
You can in mode 0, 1, 2, 3, and 4 I know that, so you probably can in all modes as they wouldnt just exclude 5... plus I think priorities would be essential when making a game for all modes. Do you need an example of sprite priority? thepernproject.com has tutorials with priorities in them.
#6323 - tepples - Fri May 23, 2003 3:45 am
niltsair wrote: |
Can the priority really be changed in Mode 3,4,5? I would have thought it was a Mode 0,1,2 only thing. |
Mode 4, likely. Mode 3 and 5 I'm not so sure about, unless Nintendo did the right thing and made bit 15 of the color value act as a Z mask.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.