Search code examples
flutterflame

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!


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.