Page 1 of 1

how to simulation mouse button down in script editor?

PostPosted: Fri Jan 29, 2010 2:12 am
by linjichao
i set canvas actor no parent, when i click on button that is child of view, how to contact with canvas actor?
i mean, is that a way simulation click canvas actor when i click button at the same time?
Thanks in advance

Re: how to simulation mouse button down in script editor?

PostPosted: Fri Jan 29, 2010 5:25 am
by skydereign
Well you can reference it like this. Not sure what you want to do with it and I am pretty sure there is more to the
Code: Select all
canvasActorName.x=0;


Another method to reference the canvas actor is to grab its Actor*, which can be done and used like this.
Code: Select all
Actor* canvasActor = getclone("canvasActorName");
canvasActor->x = 0;


Both of these methods allow for use of other actors when dealing with an event. I don't think this is exactly what you wanted, if not than can you explain more? Did you want to drag the canvas actor when clicking the button?

Re: how to simulation mouse button down in script editor?

PostPosted: Fri Jan 29, 2010 8:41 am
by linjichao
skydereign wrote:Well you can reference it like this. Not sure what you want to do with it and I am pretty sure there is more to the
Code: Select all
canvasActorName.x=0;


Another method to reference the canvas actor is to grab its Actor*, which can be done and used like this.
Code: Select all
Actor* canvasActor = getclone("canvasActorName");
canvasActor->x = 0;


Both of these methods allow for use of other actors when dealing with an event. I don't think this is exactly what you wanted, if not than can you explain more? Did you want to drag the canvas actor when clicking the button?


thank you for your reply...
i find out there is my degister problem...
but now, i know GameEditor script have Actor data type... hehe