san40511 Posted May 6, 2016 Share Posted May 6, 2016 I tried repeat my image and scroll but something went wrong. it doesn't work bg appear as normal image and I see the picture like this. It just scrolled but not repeated. screenshot : window.onload = function () { var width = 640; var height = 960; var windowRatio = window.innerWidth / window.innerHeight; if (windowRatio < width / height) { height = width / windowRatio; } game = new Phaser.Game(width, height, Phaser.AUTO,""); game.state.add("PlayGame", playGame); game.state.start("PlayGame"); }; playGame.prototype = { render : function () { game.scale.pageAlignHorizontally = true; game.scale.pageAlignVertically = true; game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; }, preload: function () { game.stage.disableVisibilityChange = true; game.load.image("base", "base.png"); }, create: function () { this.bg = game.add.tileSprite(0,0, game.width, game.height, 'base'); }, update : function(){ this.bg.x-- } } Link to comment Share on other sites More sharing options...
san40511 Posted May 7, 2016 Author Share Posted May 7, 2016 oh... I've found my stupid mistake. I've written this.bg.x-- instead this.bg.tilePosition.x--; Link to comment Share on other sites More sharing options...
rich Posted May 8, 2016 Share Posted May 8, 2016 It's never obvious, until it's obvious Link to comment Share on other sites More sharing options...
san40511 Posted May 16, 2016 Author Share Posted May 16, 2016 On 08.05.2016 at 1:44 AM, rich said: It's never obvious, until it's obvious Yeah. We always spend the most time to fix little stupid bugs but it happens to everyone from time to time Link to comment Share on other sites More sharing options...
Recommended Posts