Layer priority
Moderator: Stef
Layer priority
Is it possible to render both A and B planes before the sprite layer, Or changing said order dynamically?
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: Layer priority
Yep :
put plan B and plan A in high priority while using low priority sprites.
You can set priority per tile on plan, and per sprite, that offer many possibilities
put plan B and plan A in high priority while using low priority sprites.
You can set priority per tile on plan, and per sprite, that offer many possibilities
Re: Layer priority
And don't forget that the priority bit is per-tile in plane A and B.
But yeah, that's the purpose of the priority bit. In order (from furthest to nearest):
But yeah, that's the purpose of the priority bit. In order (from furthest to nearest):
- Background color
- Low priority plane B
- Low priority plane A
- Low priority sprites
- High priority plane B
- High priority plane A
- High priority sprites
Sik is pronounced as "seek", not as "sick".
Re: Layer priority
Cool. Any examples how to manipulate the priority in a map?
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: Layer priority
You can update / set TileMap using the VDP_fillTileMapxxx(...) or VDP_setTileMapxxx(...) methods.
Then you can use the TILE_ATTR(..) or TILE_ATTR_FULL(..) macros on any methods (mentioned above) using basetile or baseflags arguments.
But before telling you that, you need to know how work the Megadrive VDP and what is a tilemap
Then you can use the TILE_ATTR(..) or TILE_ATTR_FULL(..) macros on any methods (mentioned above) using basetile or baseflags arguments.
But before telling you that, you need to know how work the Megadrive VDP and what is a tilemap
Re: Layer priority
What values do i insert into TILE_ATTR_FULL as layer priority?
Currently im doing this:
but the order doesnt seem to work how i want it to.
do the layer priorities go through 0 to 1 or something else?
Currently im doing this:
Code: Select all
VDP_drawImageEx(PLAN_A, &plan_a0, TILE_ATTR_FULL(PAL0, 1, FALSE, FALSE, ind), 0, 0, FALSE, TRUE);
ind += plan_a0.tileset->numTile;
VDP_drawImageEx(PLAN_B, &plan_b0, TILE_ATTR_FULL(PAL0, 0, FALSE, FALSE, ind), 0, 0, FALSE, TRUE);
ind += plan_b0.tileset->numTile;
VDP_drawImageEx(PLAN_A, &plan_a1, TILE_ATTR_FULL(PAL0, 1, FALSE, FALSE, ind), 0, 16, FALSE, TRUE);
ind += plan_a1.tileset->numTile;
VDP_drawImageEx(PLAN_B, &plan_b1, TILE_ATTR_FULL(PAL0, 0, FALSE, FALSE, ind), 0, 30, FALSE, TRUE);
ind += plan_b1.tileset->numTile;
do the layer priorities go through 0 to 1 or something else?
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: Layer priority
That is the correct way of doing that. What is the result you obtain and what you expected exactly ?
Re: Layer priority
Nevermind, High priority planes seem to work by using the priority numbers 5&6
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: Layer priority
priority number 5&6 ??
Normally you should use 0 / 1 values (or FALSE / TRUE) for priority field otherwise you hit other fields (with 5/6 you change palette info as well).
Normally you should use 0 / 1 values (or FALSE / TRUE) for priority field otherwise you hit other fields (with 5/6 you change palette info as well).