geosith Posted July 13, 2018 Share Posted July 13, 2018 Hi, I'm new to phaser 3. In Construct 2 is really easy to add image points to a sprite. Please look at the screenshots. How can I add an imagepoint to a sprite like this in phaser? I tried doing this.needle.setOrigin(this.needle.width / 2, 0 ); But it doesnt work, the sprite is just not displayed EDIT: So I managed to do it by setting this.needle.setOrigin(0.5 , 0); Now, I'm trying to check collision between 2 objects. create(){ this.wheel = this.physics.add.staticSprite(400,120,"wheel"); this.needle = this.physics.add.sprite(400, this.initPosY, "needle"); this.physics.add.collision(this.needle, this.wheel, this.needleHit); } needleHit(): void { console.log("AH!"); } needleHit() is being called every tick whenever the needles approaches a little bit to the wheel. Is there any way to see the canvas size of the wheel , like for debugging? because they are not touching each other Link to comment Share on other sites More sharing options...
Recommended Posts