Layer priority

SGDK only sub forum

Moderator: Stef

Post Reply
Boyfinn
Interested
Posts: 38
Joined: Sat Aug 08, 2015 12:12 pm
Location: Lapland, Finland

Layer priority

Post by Boyfinn » Thu Apr 05, 2018 4:00 pm

Is it possible to render both A and B planes before the sprite layer, Or changing said order dynamically?

User avatar
Stef
Very interested
Posts: 2689
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: Layer priority

Post by Stef » Thu Apr 05, 2018 4:11 pm

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 :)

User avatar
Sik
Very interested
Posts: 652
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: Layer priority

Post by Sik » Thu Apr 05, 2018 6:44 pm

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):
  • Background color
  • Low priority plane B
  • Low priority plane A
  • Low priority sprites
  • High priority plane B
  • High priority plane A
  • High priority sprites
Note: window plane takes up the same layer as plane A.
Sik is pronounced as "seek", not as "sick".

Boyfinn
Interested
Posts: 38
Joined: Sat Aug 08, 2015 12:12 pm
Location: Lapland, Finland

Re: Layer priority

Post by Boyfinn » Thu Apr 05, 2018 9:05 pm

Cool. Any examples how to manipulate the priority in a map?

User avatar
Stef
Very interested
Posts: 2689
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: Layer priority

Post by Stef » Fri Apr 06, 2018 7:59 am

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 ;)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest