Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Scaling and positioning of parallax layers

I’m implementing a parallax background for my 2d side-scrolling game with Flame, similar to the example.

The ParallaxComponent api seems to support only placing layers using Alignment which puts them to the top/center/bottom of the screen.

I wonder if there’s a way to position layers more precisely and change their size. Thanks!

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The API of ParallaxComponent doesn’t support this yet, but what you could do is using multiple ParallaxComponents on top of each other since they are PositionComponents that you can place and size as you like.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading