Sign in to follow this  
Followers 0
zeroZshadow

mouse over

6 posts in this topic

is there a way so i can check if my mouse in over the picture??

like a function that returns 1 if it is above it and 0 if it isn't

thanks


*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...

Share this post


Link to post
Share on other sites



is there a way so i can check if my mouse in over the picture??

like a function that returns 1 if it is above it and 0 if it isn't

thanks

<{POST_SNAPBACK}>

Yes, but the image like a control(GUI), browser?

Share this post


Link to post
Share on other sites

Yes, but the image like a control(GUI), browser?

<{POST_SNAPBACK}>

you could just have a loop check mouse coords vs pic coords, and perform statements when the two coincide...check out MouseGetPos(),if the position of the image isn't static, you may want to make use of ControlGetPos() to specify the area you want for the mouse over...with those two functions and a loop w/ condition check, you should have no prob.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

so you mean like:

if $mouseposX  > ($picX-1) and < ($picX+picwidht+1) then
 if $mouseposY  > ($picY-1) and < ($picY+picheight+1) then
   return 1
 endif
endif

*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

so you mean like:

if $mouseposX  > ($picX-1) and < ($picX+picwidht+1) then
 if $mouseposY  > ($picY-1) and < ($picY+picheight+1) then
   return 1
 endif
endif

<{POST_SNAPBACK}>

definitely on the right track (except the statement to the right of your and statement isn't one that would be evaluated the way you want it to). try something like this...

$pos = GetMousePos()
$cpos = ControlGetPos("MyWindow","",1111)
if $pos[0] > $cpos[0] and $pos[0] < $cpos[0] + $cpos[2] then
if $pos[1] > $cpos[1] and $pos[1] < $cpos[1] + $cpos[3] then
      MouseOverFuncNameHere()
EndIf
EndIf

***edit***

i hadn't initially given the ControlGetPos() the parameters it wanted. the only real changes you would have to make to use that codebit are the arguments for ControlGetPos() and the function name to call when the mouse is over the pic.

Edited by cameronsdad

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

is there a way so i can check if my mouse in over the picture??

like a function that returns 1 if it is above it and 0 if it isn't

thanks

<{POST_SNAPBACK}>

Prevoius suggestions absolutely right for foreign windows. But if you work with Autoit GUI, simpler to use GUIGetCursorInfo, it's return control ID where mouse over (fourth element of return array).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0