Drawing layers. (How can I make one object draw 'over' another?)

Started by trevbot, Wed 11/03/2009 07:06:21

Previous topic - Next topic

trevbot

Okay, so I have a door 'object' which I have made an opening animation for. It plays fine.
My problem is that when the door is closed and the player walks near it, the door is drawn over-top of the player. I would like it to be the other way around, so that the player appears to be in front of the door. Is there something I can script for this? (Or better yet a property I can change?)

-T

RickJ

Presumably the animated door is an AGS room object.  If so then all you need to do is set the object's baseline properly.   A base line is a horizontal reference line.   In the base of the character is below (lower on the screen) the base line it will be drawn in fromt of the door, otherwise it will be drawn behind.

Dualnames

To add more info:

oObject1.Baseline=120;
oObject2.Baseline=121;

Since oobject2's baseline property is bigger (even by one) it will all of it be drawn over object 1. You can put a boolean variable so when the door is closed you can set a fixed baseline for the door.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

SMF spam blocked by CleanTalk