|
Post by Guilect on Mar 24, 2007 8:47:00 GMT -5
I have made changes to the mouse.hide and mouse.show routines. The results are good.
|
|
|
Post by u9 on Mar 24, 2007 10:02:04 GMT -5
The co-ordinates are shifted the height of the titlebar. This is not entirely true is it? If I move the mouse in the other direction, e.g. upwards, when i set it to x, -1 it is positioned 1 pixel above the drawing surface, not the screen title window. This is getting a bit confusing i think hehe We had decided that the entire window should be 640x480. As it is now. Maybe a note stating thta setmouse is a fullscreen only command is applicable. Then yeah, mouse.setposxy is only really usable in fullscreen. This renders my previous solution a bit invalid. It did however work in v1.7, but i noticed when i compiled it the coordinates got shifted. Back to the mouse.capture i guess EDIT: Ah, the mouse.dx and dy can probably still be used to see if the mouse has left the window.
|
|
|
Post by transdiv on Mar 24, 2007 10:22:34 GMT -5
Yeps; Nice workaround, works like a charm; Maybe in the future, it would be nice to have one mouse property like this :
Mouse.InAppWindow
That would return True or False depending on the mouse position.
|
|
|
Post by u9 on May 3, 2007 14:06:16 GMT -5
Hey transdiv. I have made the code into an easy to use class that you can use as if it was the original mouse object provided by Brutus2D. It has all the methods and properties of the original mouse object. It also ignores events if the window doesn't have focus, so clicks that are intended for other applications are not received by your game. I even made a Mouse.InWindow property "for you." See GDN's documentation page for more details. And by all means, do let me know what you think and if there are any problems with it
|
|
|
Post by hartnell on May 3, 2007 21:59:18 GMT -5
Disclosure : I didn't read the entire thread. But here's my two cents.
FreeBASIC does it this way :
If the mouse cursor is out of the game window, then mouse_x and mouse_y = -1
Very handy.
-hartnell
|
|