Hi everyone!
I try to make a small project with the stef's devkit, but i have a small problem with sprites.
When i try to draw more than one sprite, only the first is drawed.
I use VDP_setSpriteP to init sprite, like this :
VDP_setSpriteP(0,24,64,SPRITE_SIZE(4,4), 0, 0);
VDP_setSpriteP(1,64,64,SPRITE_SIZE(4,4), 0, 1);
VDP_setSpriteP(2,128,64,SPRITE_SIZE(4,4), 0, 2);
But only one sprite appairs one the screen.
How can i draw 3 sprites correctly?
Thanks in advance!
Stef devkit - Sprite drawing problem
Moderator: Stef
Up, one year after... ^^
I'm sorry but i would like to draw some sprites in different order.
Actually, i just want to manage drawing prority of sprites as in Crusader of Centy ( for exemple ^^ ) :
I tried but when link properties aren't in order like ( 3;2;1;0 ), nothing appears.
With Gendev kit is it possible to do that?
I'm sorry but i would like to draw some sprites in different order.
Actually, i just want to manage drawing prority of sprites as in Crusader of Centy ( for exemple ^^ ) :
I tried but when link properties aren't in order like ( 3;2;1;0 ), nothing appears.
With Gendev kit is it possible to do that?
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Sprites priority is handle by the sprite link field. Last draw sprite has the highest priority. It should work in GenDev, don't forget that a link of 0 mean the end of the list, also the list can't be more than 80 sprites (VDP stop parse after that).
For instance you can do :
that means sprite will be draw in this order :
0, 5, 8, 2, 4, 3, 7, 1 end
with sprite 1 being the last drawn sprite so over all others...
For instance you can do :
Code: Select all
spr link
0 5
1 0
2 4
3 7
4 3
5 8
6 9
7 1
8 2
9 10
0, 5, 8, 2, 4, 3, 7, 1 end
with sprite 1 being the last drawn sprite so over all others...