Manipulating sprite overlap?

For anything related to VDP (plane, color, sprite, tiles)

Moderators: BigEvilCorporation, Mask of Destiny

Post Reply
djcouchycouch
Very interested
Posts: 710
Joined: Sat Feb 18, 2012 2:44 am

Manipulating sprite overlap?

Post by djcouchycouch » Mon Apr 23, 2012 4:42 pm

Hi,

Are there ways to change the way sprites overlap each other? I know sprite priorities affect how they've drawn relative to the backgrounds, but what do I do if I want certain sprites to be under or over other ones? Are sprites with higher index (set with VDP_setSprite(index, etc) for example) simply drawn over the lower ones?

Thanks!
DJCC

oofwill
Very interested
Posts: 173
Joined: Mon May 03, 2010 6:12 pm
Location: France - Niort

Post by oofwill » Mon Apr 23, 2012 5:24 pm

I think the order is set by the first parameter of VDP_setSprite function.

On screen, Sprite 0 is above 1 to 79, 1 is above 2 to 79, etc
sprites with higher index (set with VDP_setSprite(index, etc) for example) simply drawn over the lower ones?
sprites with LOWER index will be drawned over the HIGHER ones
Last edited by oofwill on Tue Apr 24, 2012 1:26 pm, edited 1 time in total.

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

Post by Stef » Mon Apr 23, 2012 7:38 pm

Exactly, sprites are draw in the order they appear in the sprite list...
First sprite in the list is the first draw sprite.

Post Reply