How to setup Parallax backgrounds

Hello, I’ve been searching for MTE tutorials about Parallax, but I’ve not been able to find any.

I also tried copying the layer properties from the Sonic sample, but I just don’t understand how it works.

Any help would be greatly appreciated, how to setup parallax starting from 0 ?

Thank you !

Bump  :frowning:

I remember during one of the corona geeks show. I think ed commented about the jungle sample as a great example of PS.

T.

The jungle sample is not using MTE, as far as I know…

Here’s what I did in Tiled… But it doesn’t seem to work, I tried tweaking settings without success.

140725115505844628.png

Bump, I really need help… Can’t get it to work… Please.

I don’t understand what you are trying to achieve using parallax, I did some quick search on understanding the term better but I still am not too sure what you are trying to do.

Quick search found “parallax is used to provide a sense of “distance” between the camera and moving objects that recede back”, which wouldn’t that be just done using “scale” as shown in the CastleDemo to show depth and layers popping out and getting further and closer away depending on going up and down layers. What I learned using the MTE to make good use out of the “faux 3-d” you need to use tricks of the trade graphics to add depth or abuse MTE layers and scale to add depth like walls as shown in castle Demo but almost need to do a “birds eye perspective” to make it work properly (which can’t really be achieved from your game angle being at a 45 degrees? because how do you make that pop out while making it look natural)

Thank you for your help, Azmar. In fact, what I’m trying to achieve is the exact same thing as the Sonic sample. But even by copying/pasting the settings to my game, it doesn’t work.

You are asking of the way the camera zooms in and out based off the sonic is moving or not??

Looks like its done right here:

if display.fps == 60 then &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;local zoomFactor = 1.5 - (abs(velX) / maxVelX \* 0.3) &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if currentZoom \< zoomFactor and abs(currentZoom - zoomFactor) \>= 0.006 then &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;currentZoom = currentZoom + 0.006 &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;elseif currentZoom \> zoomFactor and abs(currentZoom - zoomFactor) \> 0.004 then &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;currentZoom = zoomFactor &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;end &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;mte.zoom(currentZoom, 2) &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;mte.debug(30) &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;end

He just zooms it (in or out) based on the current velocity of the player using mte.zoom

No… The parallax effect…

https://www.youtube.com/watch?v=8RZRE0M3Hvc

Bump  :frowning:

I remember during one of the corona geeks show. I think ed commented about the jungle sample as a great example of PS.

T.

The jungle sample is not using MTE, as far as I know…

Here’s what I did in Tiled… But it doesn’t seem to work, I tried tweaking settings without success.

140725115505844628.png

Bump, I really need help… Can’t get it to work… Please.

I don’t understand what you are trying to achieve using parallax, I did some quick search on understanding the term better but I still am not too sure what you are trying to do.

Quick search found “parallax is used to provide a sense of “distance” between the camera and moving objects that recede back”, which wouldn’t that be just done using “scale” as shown in the CastleDemo to show depth and layers popping out and getting further and closer away depending on going up and down layers. What I learned using the MTE to make good use out of the “faux 3-d” you need to use tricks of the trade graphics to add depth or abuse MTE layers and scale to add depth like walls as shown in castle Demo but almost need to do a “birds eye perspective” to make it work properly (which can’t really be achieved from your game angle being at a 45 degrees? because how do you make that pop out while making it look natural)

Thank you for your help, Azmar. In fact, what I’m trying to achieve is the exact same thing as the Sonic sample. But even by copying/pasting the settings to my game, it doesn’t work.

You are asking of the way the camera zooms in and out based off the sonic is moving or not??

Looks like its done right here:

if display.fps == 60 then &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;local zoomFactor = 1.5 - (abs(velX) / maxVelX \* 0.3) &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if currentZoom \< zoomFactor and abs(currentZoom - zoomFactor) \>= 0.006 then &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;currentZoom = currentZoom + 0.006 &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;elseif currentZoom \> zoomFactor and abs(currentZoom - zoomFactor) \> 0.004 then &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;currentZoom = zoomFactor &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;end &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;mte.zoom(currentZoom, 2) &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;mte.debug(30) &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;end

He just zooms it (in or out) based on the current velocity of the player using mte.zoom

No… The parallax effect…

https://www.youtube.com/watch?v=8RZRE0M3Hvc