Jump to content

How to stretch tileSprite to fullscreen in Phaser?


weratius
 Share

Recommended Posts

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 repeated

and also it's not stretched to fullScreen on bigger screens

 

image is attached

 

Thank you in advance for your help))

post-14308-0-22388800-1431628345_thumb.p

Link to comment
Share on other sites

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

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...