How do the coordinates of the mouse as a seperate raw int? I'm trying to create a little 2D draw tool that places a pixel whenever you press the left mouse button, but i'm stuck as my pixels just keep following the mouse
Thanks!
Mouse Loc
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: Mouse Loc
There are two modes of use for the mouse and keyboard. One is state and one is event driven. If you use if( mouse.LeftIsPressed() ) then for however many frames you hold the left mouse button down, this function returns true.
If you want a single button press event, you must use mouse.Read() to get a Mouse::Event object. Then you must verify the event is a button down or button up event and handle it that way.
If you want a single button press event, you must use mouse.Read() to get a Mouse::Event object. Then you must verify the event is a button down or button up event and handle it that way.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com