Page 1 of 1

ZDepth. How can I add/substract it in game mode?

PostPosted: Thu Sep 11, 2014 2:04 pm
by xenidius93
There's
ChangeZDepth("Event Actor", 0.500000);

but I want to add/substract some, in game. How can I write it (in Draw Actor)?
I want to make "3D" effect.

If actor's Y position is 0 ZDepth = 0.5
If actor's Y position is 1 ZDepth = 0.500001
If actor's Y position is 2 ZDepth = 0.500002 etc.

Re: ZDepth. How can I add/substract it in game mode?

PostPosted: Fri Sep 12, 2014 1:33 am
by skydereign
For now you need to create a zdepth variable to use. That way you can manipulate the variable and use ChangeZDepth("Event Actor", zdepth).

Re: ZDepth. How can I add/substract it in game mode?

PostPosted: Fri Sep 12, 2014 9:46 pm
by Zivouhr
I noticed the word 3D was used. ZDepth is more like layers in a photo editor like Photoshop or Gimp, where it remains the same size, just can be placed behind other layers depending on where the ZDepth slider is at. Unless there is something I missed, I wonder how it could be used to scale an object to look larger than it was at first. ? Not sure.

There's a demo showing Mode 7 more or less on this forum. Also check out LCL's Sabre demo, which is pretty amazing considering this is a 2D program without any built in sprite scaling feature from what I found so far. It's like the classic Wolfenstein 3D.

Re: ZDepth. How can I add/substract it in game mode?

PostPosted: Fri Sep 12, 2014 10:12 pm
by skydereign
Zivouhr wrote:I noticed the word 3D was used. ZDepth is more like layers in a photo editor like Photoshop or Gimp, where it remains the same size, just can be placed behind other layers depending on where the ZDepth slider is at. Unless there is something I missed, I wonder how it could be used to scale an object to look larger than it was at first. ? Not sure.

ZDepth can be used to fake 3d, especially if you are going for an orthographic view. A lot of 2.5d games simulate a 3d world by setting the zdepth layer based off of the y positional value. The further up they are on screen, the further back they should be.

Re: ZDepth. How can I add/substract it in game mode?

PostPosted: Thu Sep 18, 2014 8:37 am
by xenidius93
Thanks, ChangeZDepth("Event Actor", zdepth) it's working :D.