I need to repeat an image to fill my ground area as I added to the stage like
var firstGround=platforms.create(config.width/2, config.height, 'main');
and changed the size to fill the game stage width as
firstGround.displayWidth=config.width;
but the image is skewing to fill the area, I need parallax image repeating, how can I achieve it?
I’m a newbie, is TileSprites static?
as
platforms = this.physics.add.staticGroup()
A TileSprite
is just like any other GameObject
(a Sprite
, an Image
, etc…). So they can be used in an Arcade Physics group as static bodies
1 Like
Thanks
var mainGround = this.add.tileSprite(0, 0, config.width, 100, ‘main’);
this.physics.add.existing(mainGround, true);
this worked for me.
1 Like