Page 1 of 1

Make an actor change trasparency with mouse movement

PostPosted: Fri Jan 28, 2011 3:44 pm
by DBGames
i have an actor that needs to change transparency when
a.) my mouse is moving
or
b.) my mouse is still
how do i do it?

Re: Make an actor change trasparency with mouse movement

PostPosted: Fri Jan 28, 2011 10:58 pm
by NightOfHorror
YOUR BACK! :D

Re: Make an actor change trasparency with mouse movement

PostPosted: Sat Jan 29, 2011 6:15 am
by skydereign
Create two variables, one for xmouse, and one for ymouse. Something like mousexp and mouseyp.
view -> Draw Actor -> Script Editor
Code: Select all
mousexp=xmouse;
mouseyp=ymouse;


Then if you want to know if the mouse is moving, use this.
Code: Select all
if(xmouse!=mousexp || ymouse!=mouseyp)
{
    // execute code
    // so if you want to change transparency, do it here (this would be a draw event then)
}

Re: Make an actor change trasparency with mouse movement

PostPosted: Sat Jan 29, 2011 1:06 pm
by Game A Gogo
wouldn't it be easier to have the view's code just after the other code?
Unless view's draw actor is always executed last... which should be quite handy

Re: Make an actor change trasparency with mouse movement

PostPosted: Sun Jan 30, 2011 12:15 am
by skydereign
Yeah, that was a possible problem, but it worked when tested, but I don't actually know if it is executed last. The reason I didn't want to put it at the end of the visibility code is so that multiple actors can have the event triggered.