Hi all,
I recently made this simple class to create a horizontal parallax effect using blitter objects.
Repository: https://github.com/jjcapellan/Phaser3-scrollinglayer/
Demo: https://jjcapellan.github.io/Phaser3-scrollinglayer/
How works:
This class creates a blitter that generates two bob objects with the same texture. These objects are located next to each other. When the object on the left is off screen, it is repositioned to the right of the other object.
Performance:
Testing in Huawei Y635 1GB.
(hi res assets. Images width == game width, 6 layers)
- 1920x1080 / WEBGL:
… * TileSprite: CONTEXT_LOST_WEBGL
… * ScrollingLayer: 14 FPS - 1920X1050 / CANVAS:
… * TileSprite: 16 FPS
… * ScrollingLayer: 28 FPS
(low res assets. Images width == game width, 6 layers) - 960x540 / WEBGL:
… * TileSprite: 48 FPS
… * ScrollingLayer: 50 FPS - 960x540 / CANVAS:
… * TileSprite: 40 FPS
… * ScrollingLayer: 60 FPS
Mmm, I have to change my mobile
Information on how to use this class is available in the repository.
Regards.