meowbits Posted May 6, 2009 Share Posted May 6, 2009 Have it setup so the user defines the game dimensions. Those are set as $left, $top, $right, $bottom. I have the coordinates of where I want to click in a percentage based off of the game dimensions that the user picked. 77.63%, 91.37% How do I set it up so that it will click at that coordinate? - and effectively click in the same spot regardless of computer resolution/size Your help is much appreciated! Link to comment Share on other sites More sharing options...
weaponx Posted May 6, 2009 Share Posted May 6, 2009 Simple math here... @DesktopWidth * (77.63/100) @DesktopHeight * (91.37/100) Link to comment Share on other sites More sharing options...
meowbits Posted May 6, 2009 Author Share Posted May 6, 2009 Simple math here...@DesktopWidth * (77.63/100)@DesktopHeight * (91.37/100)Desktop isn't what I need.When it starts, you're prompted to click the outside edges of the browsergame screen.So the screen could be moved to the top left, or right.. ect.I need a way to make it so the % is based off of the coordinates that the user picked. Link to comment Share on other sites More sharing options...
bluebearr Posted May 6, 2009 Share Posted May 6, 2009 Maybe this? $ClickX = Round(($right - $left)*(77.63/100), 0) + $left $ClickY = Round(($bottom - $top)*(91.37/100), 0) + $top BlueBearrOddly enough, this is what I do for fun. Link to comment Share on other sites More sharing options...
meowbits Posted May 6, 2009 Author Share Posted May 6, 2009 Thank you!! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now