Set position to(Mouse.X,Mouse.Y)Chrome performance

Forum Home Forum Home > Construct 2 General > Construct 2 general
 Post Reply Post Reply Page  <12
Author
4,922 Rep
Post Options Post Options   Quote TL22 Quote  Post ReplyReply Direct Link To This Post Posted: 25 Feb 2012 at 11:59pm
Let's say you had a sprite called CursorSprite that you wanted to use as your mouse cursor. You set CursorSprite's position to Mouse.X and Mouse.Y every tick and hide the default mouse cursor by setting the Mouse's cursor type to "none".

Then you only test for the CursorSprite's position. Instead of doing "is mouse over object?" you do "is CursorSprite overlapping object?" And instead of comparing "Mouse.X" or "Mouse.Y", you compare "CursorSprite.X" and "CursorSprite.Y". The only mouse conditions you would really end up needing are the "On button clicked/button down" conditions.

That's how I do it anyway.
Back to Top
5,705 Rep
Post Options Post Options   Quote cesisco Quote  Post ReplyReply Direct Link To This Post Posted: 26 Feb 2012 at 2:24pm
Originally posted by TL22 TL22 wrote:

Let's say you had a sprite called CursorSprite that you wanted to use as your mouse cursor. You set CursorSprite's position to Mouse.X and Mouse.Y every tick and hide the default mouse cursor by setting the Mouse's cursor type to "none".

Then you only test for the CursorSprite's position. Instead of doing "is mouse over object?" you do "is CursorSprite overlapping object?" And instead of comparing "Mouse.X" or "Mouse.Y", you compare "CursorSprite.X" and "CursorSprite.Y". The only mouse conditions you would really end up needing are the "On button clicked/button down" conditions.

That's how I do it anyway.


Ok thanks a lot!
Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down