tileSprite and physics tiling issue

I’m having issues with a tileSprite that I am adding to my game’s physics.
Here is the code below:

var background = this.add.tileSprite(posX, game.config.height * 0.8, 0, 0, "platform");
platform = this.physics.add.existing(background, false);
background.body.setImmovable(true);
background.body.setVelocityX(gameOptions.platformStartSpeed * -1);
this.platformGroup.add(platform);
platform.displayWidth = platformWidth;

I bring in platformWidth as an argument to the function but it could be 10 or 1000 it doesn’t matter - my sprite is being scaled rather than tiled ( i.e. just one long image scaled rather than a repeated pattern of my .png’s width ). How would I change the width of my platform variable and get it to tile?

Thanks

Well, if anyone searches for this, it was kinda simple ( though I didn’t know where to look ) :slight_smile:

You can set the tileScale of your tileSprite. In this case, you’d set it to the ratio to the scale of your tileSprite ( i.e. if my width of my sprite is 150 at default and it’s been scaled to 300 that would scale your image up x 2 so … ) -

platform.tileScaleX = 1/platform.scaleX