Thursday, June 2, 2022
HomeGame DevelopmentCocos creator contact occasion - Cocos Creator

Cocos creator contact occasion – Cocos Creator


hey, how i can transfer node(sprite) like cocos 2dx in cocos creator dynamically.(wished to know contact started ,contact transfer and contact finish occasion ) in cocos creator.


https://docs.cocos.com/creator/guide/en/scripting/internal-events.html

For instance:

this.node.on(cc.Node.EventType.TOUCH_MOVE, (ev: cc.Occasion.EventTouch) => {

}, this);

hello thanks on your response. is that this work for 3.4.2?? i’ve did that means. nevertheless it isn’t working.
begin () {

    //this.node.on(Node.EventType.TOUCH_MOVE, this.onEventMove,this);

  }

onEventMove(even)
{
console.log(“began”);
let worldPoint1 = even.getLocation();

}

i can in a position to get coordinator easily however how i can straight transfer the nods?? if i used to be go straight coordinator to any node then place of node straight get out of display screen. didn’t get actual contact location… (be aware – node added straight in canvas)

this.node.setPosition(worldPoint1.x, worldPoint1.y);

that is working however contact of any node i used to be getting from far distance… as a result of convertToNodeSpace not working in 3.4.2. may you please assist me to resolve this concern.if there might be any instance then please may you in a position to publish right here.

You may get the UITransform first, then use convertToNodeSpace in v3.4.2.

@linrm are you able to please give me instance for that i didn’t in a position to get you. sorry for delayed in response i’m in another work.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments