Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: trevbot on Wed 11/03/2009 07:06:21

Title: Drawing layers. (How can I make one object draw 'over' another?)
Post by: trevbot on Wed 11/03/2009 07:06:21
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
Title: Re: Drawing layers. (How can I make one object draw 'over' another?)
Post by: RickJ on Wed 11/03/2009 07:16:10
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.
Title: Re: Drawing layers. (How can I make one object draw 'over' another?)
Post by: Dualnames on Fri 13/03/2009 12:42:42
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.