
Let skyImage = (topBackgroundXOrigin, topBackgroundYOrigin, 'background1_sky') Let heightRatio = topBackgroundHeight / imageBaseHeight ('background1_sky', 'assets/background/background1_sky.png') ('background1_rocks_2', 'assets/background/background1_rocks_2.png') ('background1_rocks_1', 'assets/background/background1_rocks_1.png') ('background1_clouds_4', 'assets/background/background1_clouds_4.png') ('background1_clouds_3', 'assets/background/background1_clouds_3.png') ('background1_clouds_2', 'assets/background/background1_clouds_2.png') ('background1_clouds_1', 'assets/background/background1_clouds_1.png') Tried Phaser v3.3.0 and have now the TileSprite scaling workingīelow is the working code for future readers. but I just don't grasp how it works.Īnything to help me continue would be appreciated, as you can imagine I would like to scale down the "rocks" so it can be adapted to any resolution for the fix ! I played with everything I could find in the TileSprite object, width, displayWidth, position, etc. The second result (ScreenShot2), with the mountains properly placed is achieved when using a simple "image" approach, and of course that's what I'd like to achieve with the TileSprite, so it can be repeated automatically from what I understood. What the TileSprite gives me is the attached result (ScreenShot1) with the mountain down below and very big. + 'displayWidth:' + + ' displayHeight:' + ) alert('tilePositionX:' + + ' tilePositionY:' + + '\n' (-0.5, 0) // not implemented in Phaser3 yet 1 = (topBackgroundXOrigin, topBackgroundYOrigin, imageBaseWidth, imageBaseHeight, 'top-rocks1-background') 1 = (topBackgroundXOrigin, topBackgroundYOrigin, 'top-rocks1-background') let newImageWidth = imageBaseWidth * (topBackgroundHeight / imageBaseHeight) tDisplaySize(windowWidth, topBackgroundHeight) Let skyImage = (topBackgroundXOrigin, topBackgroundYOrigin, 'top-sky-background') Add the sky image at the right location and resize it to take all the space, no scaling needed

Let topBackgroundHeight = (windowHeight / 5) * 3 Let topBackgroundYOrigin = (windowHeight / 5) * 1.5 Let topBackgroundXOrigin = windowWidth / 2 ('top-rocks1-background', 'assets/background/rocks_1.png') ('top-sky-background', 'assets/background/sky.png') I have been struggling for days on setting up a parallax background for the game I'm working on and I need guidance to understand "why?"īelow is where I am, and I cannot get to properly size the TileSprite to later use it for the parallax.
