Hi everyone. What is the most optimal way to display background that’s a really big png (11000px wide)?
The game idea is that the background scrolls and the player only jumps and its position doesn’t change. Currently, I’m using TileSprite to display and move the background but it sometimes stutters. Should I change it to regular Image and scroll it somehow using the X pos or maybe use the camera object to go with it?
Tile sprites shouldn’t be larger than the canvas size. If the tile sprite itself is 11000 pixels wide, the first thing you should try is using a more sensible size and scrolling the large texture with the tilePosition
property.
If that doesn’t work, you’ll have to come up with a more creative way to show the background because 11000 pixels is a massive texture that not all devices can handle well. You could, for example, split it into several smaller textures and stitch them together with separate Image objects. In this case, you would likely need only one or two chunks to exist on the display list at once.
1 Like