weratius Posted May 14, 2015 Share Posted May 14, 2015 Hello, guys! That's me again with my foolish questions)) So, the question is: How to stretch tileSprite to fullscreen ?planetSprite = game.add.tileSprite(0, 0, game.width + 500, game.height + 900, planetObject.key + 'Planet');// planetSprite.anchor.setTo(0, 0);planetSprite.scale.set(0.75, 0.6);planetSprite.fixedToCamera = true;and here I have a problem:it looks ok on my screen, but on bigger one this tileSprite is repeatedand also it's not stretched to fullScreen on bigger screens image is attached Thank you in advance for your help)) Link to comment Share on other sites More sharing options...
rich Posted May 14, 2015 Share Posted May 14, 2015 The whole point of a TileSprite is that it's a repeating pattern - the smaller the source image, the more often it will repeat. Are you sure you need to be using a TileSprite for this? It doesn't really look like it from the screen shot you posted above, to me it just looks like you're trying to stretch an image to fit the game size? Link to comment Share on other sites More sharing options...
weratius Posted May 15, 2015 Author Share Posted May 15, 2015 The whole point of a TileSprite is that it's a repeating pattern - the smaller the source image, the more often it will repeat. Are you sure you need to be using a TileSprite for this? It doesn't really look like it from the screen shot you posted above, to me it just looks like you're trying to stretch an image to fit the game size?@Rich, I'm not really sure.I use tileSprite because I need to set width and height of it on adding it to the game(There is only tileSprite with width and height arguments in adding function in documentation) so what can I use to solve my problem? Thx =) Link to comment Share on other sites More sharing options...
ZoomBox Posted May 15, 2015 Share Posted May 15, 2015 With "simple" Phaser.Sprite you can set width and height so it'll fit the entire screen.Once your sprite is created:mySprite.width = screenWidth;mySprite.height = screenHeight; weratius 1 Link to comment Share on other sites More sharing options...
Recommended Posts