Page 1 of 1

Top-Down Graphics

PostPosted: Thu Dec 20, 2012 5:15 am
by Drenrin
Hello, just started messing around with Construct 2 a few days ago and I'm loving it so far, but I'll get with it.

I'm having trouble with some top-down graphics. Similar to an ARPG, I want the effect of walking behind an object, where the player sprite fades behind it, while also being able to stand in front of it, where the player sprite does not. Now, I know I can emulate this by cutting said objects in half and placing them on separate layers. I'm just wondering if there is an easier way to achieve this that I missed somewhere.

I've searched all around tutorials and the help section and I couldn't find anything, so if the answer is out there, sorry about that.

Re: Top-Down Graphics

PostPosted: Thu Dec 20, 2012 8:12 am
by jayderyu
Well an alternative theory you could use would be to use.

On Overlap between player and object
if player.Y < object.Y -> object Z order to front
object Z orer to back

however. I would be concerned with sending the object WAY to the back where you can't see it. So be warned

Another would be to do
On Overlap of Player and Object
IF player.y < object
-> object to layer overlap
object to layer tiles

then have the player sit on a layer between overlap and tiles... something like that

Re: Top-Down Graphics

PostPosted: Thu Dec 20, 2012 8:26 am
by Drenrin
It worked. Had to do it without the "on overlap" condition though. I'm gonna have to experiment with this to see if there's a more efficient way to do it. It'd be nice if this were a behavior, or if you could event your own behaviors. Regardless, thank you!Drenrin2012-12-20 08:26:50

Re: Top-Down Graphics

PostPosted: Thu Dec 20, 2012 2:29 pm
by C-7
Juantar made a plugin to take care of this, and rexrainbow updated it to make it more stable and add some neat features. You can find a link to rexrainbow's updated version here. It works like a charm, just set in the events for it to order everything on whatever layer you need. I have it do it something like every 0.1 seconds, because its not really necessary to do it every tick. Just remember, like every non-official plugin, it means you won't be able to upload to Scirra's arcade with it.