Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Parallax Backgrounds


LuckieLordie
 Share

Recommended Posts

It depends on the effect you're after. I mean I know you want parallax of course, but if it's say for a repeating background image then I would handle it differently than if it's just for a bunch of sprites moving around.

 

If possible make use of the Tiling Sprites. They are really cheap to draw and you can alter the scroll speed using. Overlay a few tile sprites on-top of each other, with different scroll speeds and you could make a lovely easy parallax effect.

 

Otherwise you will need to do it on a sprite speed level really.

Link to comment
Share on other sites

It depends on the effect you're after. I mean I know you want parallax of course, but if it's say for a repeating background image then I would handle it differently than if it's just for a bunch of sprites moving around.

 

If possible make use of the Tiling Sprites. They are really cheap to draw and you can alter the scroll speed using. Overlay a few tile sprites on-top of each other, with different scroll speeds and you could make a lovely easy parallax effect.

 

Otherwise you will need to do it on a sprite speed level really.

 

Cool the TileSprite way seems like it suits what I'm trying to do a bit better. I'm looking at the TileSprite section in the docs but there doesn't seem to be a property I can change to alter the scroll speed. Do you know what it's called?

 

Thanks a lot for the last few days by the way these forums have been really helpful!

Link to comment
Share on other sites

  • 4 weeks later...

For future people searching "parallax" on the forums, the TileMapLayer object has two properties, ScrollFactorX and ScrollFactorY that are worth looking into. from TilemapLayer.js:

"speed at which this layer scrolls horizontally, relative to the camera (e.g. scrollFactorX of 0.5 scrolls half as quickly as the 'normal' camera-locked layers do)"
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...