how to simulation mouse button down in script editor?

Questions, comments and discussion about the Game Editor development.

how to simulation mouse button down in script editor?

Postby linjichao » Fri Jan 29, 2010 2:12 am

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
linjichao
 
Posts: 35
Joined: Fri Jan 22, 2010 10:13 am
Score: 0 Give a positive score

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

Postby skydereign » Fri Jan 29, 2010 5:25 am

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?
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

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

Postby linjichao » Fri Jan 29, 2010 8:41 am

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
linjichao
 
Posts: 35
Joined: Fri Jan 22, 2010 10:13 am
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest