rikimm Posted November 15, 2018 Share Posted November 15, 2018 Hello, I have that doubt, I try to find the equivalent of this property onChildInputDown.add () from phaser 2 to phaser 3, what would be the equivalent. I thought it could be .on (event), but I can not find the exact face for onChildInputDown, if you can help me, I'd really appreciate it. Regards Link to comment Share on other sites More sharing options...
samme Posted November 16, 2018 Share Posted November 16, 2018 There's no equivalent, but you can set hitArea and hitAreaCallback in GroupCreateConfig. Same values you would use in setInteractive(). Link to comment Share on other sites More sharing options...
rikimm Posted November 16, 2018 Author Share Posted November 16, 2018 Hi @Samme, I'm a little confused, look at this is the original code: this.cookieLayer = this.add.group(); cookies.forEach((cookie: Cookie) => { var point = this.pointForCookie(cookie.column, cookie.row); var createdCookie = this.cookieLayer.create(point.x, point.y, cookie.spriteName()); createdCookie.inputEnabled = true; createdCookie.events.onInputDown.add(this.touchesBegan, this); createdCookie.events.onInputUp.add(this.touchesEnd, this); cookie.sprite = createdCookie; }) For what you tell me, you would have to create by means of createMultiple (), to be able to access the hitArea and hitAreaCallback, as a value would be the function that I send to call? On the other hand you mention setInteractive (), I was reviewing the manual and I do not see any example that applies in creatMultiple as the following example gameObject.setInteractive().on('pointerdown', function(pointer, localX, localY, event){ // ... }); Regards. Link to comment Share on other sites More sharing options...
samme Posted November 18, 2018 Share Posted November 18, 2018 https://codepen.io/samme/pen/pQWyMG?editors=0010 Link to comment Share on other sites More sharing options...
Recommended Posts