Search the Community
Showing results for tags 'relative position'.
Hello, I would like to create a interactive zone which is relative to an existing sprite. For example, this code is working: var marcoObjs = this.add.sprite(x, y, 'marcoObjs'); var puerta1 = this.add.zone(50, 50, 100, 100) puerta1.setInteractive(); this.add.graphics().lineStyle(2, 0xff0000).strokeRectShape(puerta1); But i want the puerta1 object to be relative positioned to marcoObjs object. So if marcoObjs x,y coordinates change, puerta1 coordinates must change too. I tried this way, but is not working: var marcoObjs = this.add.sprite(x, y, 'marcoObjs'); var puerta1 = mar