PiraTa Posted January 7, 2016 Share Posted January 7, 2016 Hi, I'm started to learn phaser today and I've trouble.I'm trying to make preloader state.I've to sprites: I want to rotate this dots sprite: I tried set anchor and different things, but ineffectually. I am confused and I hope for your helpThis is part of my code:public create(): void{ this._loadingContainer = this.game.add.sprite(this.game.world.centerX - 286.65, this.game.world.centerY - 103.25, "loaderContainer" this._loaderDots = this.game.add.sprite(this.game.world.centerX - 306.8, this.game.world.centerY - 84.5, "loaderDots"); this._loadingContainer.scale.set(0.7); this._loaderDots.scale.set(0.7);}public update(): void{ this._loaderDots.rotation += 0.05;} Link to comment Share on other sites More sharing options...
drhayes Posted January 7, 2016 Share Posted January 7, 2016 Nothing happens, no rotation at all? This is kind of a dumb question... but are you sure your "update" method is getting called? You're going to need to anchor the image at (0.5, 0.5) to get it to rotate around its center. Then the position you add it to the game world will be game.world.centerX, game.world.centerY... assuming your game world isn't bigger than the screen. Link to comment Share on other sites More sharing options...
PiraTa Posted January 9, 2016 Author Share Posted January 9, 2016 drhayes Thank you for reply and sorry for a late answer.I figured out this problem. I've had a trouble with anchor and I'm continuing develop my first phaser.io game : ) drhayes 1 Link to comment Share on other sites More sharing options...
Horizonicblue Posted January 9, 2016 Share Posted January 9, 2016 drhayes Thank you for reply and sorry for a late answer.I figured out this problem. I've had a trouble with anchor and I'm continuing develop my first phaser.io game : ) So how you got it working? Link to comment Share on other sites More sharing options...
Recommended Posts