getActor question

Game Editor comments and discussion.

getActor question

Postby Leif » Mon Jan 04, 2010 10:10 pm

Script Editor Syntax:
Actor *MyActor;
MyActor=getactor(x,y);

Question: what if there are several actors at (x,y) ?? I mean - background_1, background_2,player and something else (for example). How can i get exactly needed actor (player) ?
Repulsor beam + heavy cannons
User avatar
Leif
 
Posts: 147
Joined: Mon Dec 15, 2008 12:42 pm
Location: Moscow, Russia
Score: 10 Give a positive score

Re: getActor question

Postby skydereign » Mon Jan 04, 2010 11:26 pm

getactor will take the actor with the highest zdepth. Really what it is doing is taking the visible actor at pixel position, (x,y).
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: getActor question

Postby Leif » Tue Jan 05, 2010 6:52 am

And if the actor with the highest zdepth is filled region (transparent) we get visible actor behind it ,right?
Repulsor beam + heavy cannons
User avatar
Leif
 
Posts: 147
Joined: Mon Dec 15, 2008 12:42 pm
Location: Moscow, Russia
Score: 10 Give a positive score

Re: getActor question

Postby skydereign » Tue Jan 05, 2010 8:21 am

I don't think so. The getactor will pick up the filled region, unless you meant if the filled region's transp is set to 1, then yes it will get the actor behind it. Just so you know, any actor is transparent if its transp is higher than 0.996078. Something to note is that the getactor is completely dependent on the transp value, as if you have an actor that has its visibility state turned off, but still allows events, than it will still get that actor. The only two ways to get the actor below the one you want is to either disable its visibility state or to raise its zdepth higher than 0.996078. Wireframe regions only count if the frame itself lies on the xy coordinate, and canvas acts just like a filled region.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron