Shex Posted March 21, 2018 Share Posted March 21, 2018 Hi In Phaser2, it was possible to scale a TileSprite so the sprite inside was scaled while being tiled. It doesn't seem to be there anymore in Phase3. Is there a way to achieve this? Thanks! Link to comment Share on other sites More sharing options...
VincentB Posted March 21, 2018 Share Posted March 21, 2018 @Shex could it be related to what I'm trying to do here ? I saw as well that we could scale the TileSprite in Phaser 2, like here https://phaser.io/examples/v2/tile-sprites/animated-tiling-sprite tilesprite.tileScale.x = ... tilesprite.tileScale.y = ... Link to comment Share on other sites More sharing options...
Shex Posted March 21, 2018 Author Share Posted March 21, 2018 Hi Vincent As I understand, the TileSprite works like a frame. You set a size (width, height) and you set a position on screen, then the framework will render a sprite inside that frame until it fills it (a bit like a background image in CSS). What I'm trying to do is being able to scale the sprite it is using to fill the frame. For exemple, using a 128x128 image and scale it to 256x256 before using it to fill the frame. On the project I am working on, I have a constraint about the base image file so it would save me a lot of trouble to be able to scale it to a certain size. Link to comment Share on other sites More sharing options...
samme Posted March 21, 2018 Share Posted March 21, 2018 It looks like tileScale doesn't exist in Phaser 3. You may be able to get the same effect by scaling the sprite: this.add.tileSprite(400, 300, 0.5 * 150, 0.5 * 150, 'image1').setScale(2); Link to comment Share on other sites More sharing options...
Shex Posted March 21, 2018 Author Share Posted March 21, 2018 I tried the scale methods but it doesn't seem to work. Is it a bug? Link to comment Share on other sites More sharing options...
Recommended Posts