Jump to content

Group set origin


andrei.nicolae
 Share

Recommended Posts

Hi guys,

How can you change the anchor of a sprite inside a group?

For a sprite outside the group I use this.add.sprite(100,100, 'sprite').setOrigin(0,0);

I tried the next code but It didn't work            

leprosy = this.add.group([{
                    key: '001_leprosy',
                    setXY: {
                        x: 444,
                        y: 115
                    }, 

                    setOrigin {x:0, y:0}
                }
            ]);

Any ideas?

Thanks.

Link to comment
Share on other sites

this.enemies = this.physics.add.group({
  key: 'tai_fighter1',
  createMultiple: 5,
  enableBody: true,
  physicsBodyType: Phaser.Physics.ARCADE,
  frame: 4,
  angle: 180,
  checkWorldBounds: true,
  outOfBoundsKill: true
})

Phaser.Actions.setOrigin(this.enemies.getChildren(), -0.7, -0.7)

could you change the origin the same way i scale each child of a group ?????

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...