|
Post by hartnell on Nov 3, 2006 23:19:42 GMT -5
---------------------
It would be nice to manually set the mouse position :
mouse.SetX mouse.SetY
------------------------- It would be nice to Lock (disable) buttons
mouse.LockRightButton mouse.LockLeftButton mouse.Lock.MiddleButton
And unlock them
mouse.UnlockRightButton ...etc...
-----------------------------
To see if no mouse button is pressed
Mouse.NoButton
To see if any mouse button is pressed
Mouse.AnyButton
---------------------------------
To pause until the player presses a mouse button
Mouse.Wait
----------------------------
To detect only at the exact moment the mouse is pressed
Mouse.HitRightButon
or
Mouse.Hit(3)
----------------------------------
To detect only at the exact moment the mouse is released
Mouse.ReleasedRightButton
or
Mouse.Released(3)
--------------------
Some of these are useful for the keyboard too
-hartnell
|
|
|
Post by Guilect on Nov 4, 2006 8:45:03 GMT -5
This I think can be done in DirectX, I'll see. I know it can be done in plain Win32.
The other mouse commands I would have thought people would have just coded it in their program that way. e.g. If you don't want to see a mouse button press then either don't read it or ignore it.
Your requests are welcome and I have added them to the todo list.
|
|
|
Post by hartnell on Nov 4, 2006 10:07:01 GMT -5
These very common in game programming languages (PlayBasic), game design software (Game Maker), and game programming libraries (Allegro). People would rather not think about how to check to see the mouse has been hit during that iteration of the game loop. Most people would (including myself) would just want a function to do it.
I have some old code from FreeBASIC for a mouse library I could update to Brutus2D if you want it.
-hartnell
|
|
|
Post by hartnell on Nov 4, 2006 10:35:09 GMT -5
I'll just convert it to Brutus2D to save you time.
-hartnell
|
|
|
Post by OddChild on Nov 4, 2006 17:16:41 GMT -5
in the mean time... i have a DLL that can do 90% of those things that you requested... PM me for details
|
|
|
Post by u9 on Nov 9, 2006 6:41:24 GMT -5
Guilect, I see you have added these for the next release. Could you also add mouse.setXY so it can be done with one call aswell? It would be nice to Lock (disable) buttons mouse.LockRightButton mouse.LockLeftButton mouse.Lock.MiddleButton And unlock them mouse.UnlockRightButton ...etc... I don't see the sence in this. What do you mean lock/unlock the buttons? If you want to ignore the mouse button(s), can't you just ignore it?
|
|
|
Post by Guilect on Nov 9, 2006 20:39:42 GMT -5
Update: the one and only command to set the mouse position is:
mouse.SetPosXY valueX, ValueY
|
|
|
Post by u9 on Nov 11, 2006 8:54:14 GMT -5
I recommend keeping the naming convention and calling it mouse.setXY which it is called for both graphics and fx objects.
|
|
|
Post by Guilect on Nov 11, 2006 18:34:18 GMT -5
I would have liked to have kept the same calling convention, but there would be a problem with doing that.
To explain: both graphics and fx have a setXY command that take 3 parameters --> graphics.SetXY image, valueX, valueY
The mouse only 2 --> Mouse.SetXY valueX, valueY
Now the problem: The intellisense routine that is in Brutus2D (you know when you type a keyword and a helpful pop up displays the parameters) can only recognize ".SetXY". It can not distinguish between Mouse or FX or Graphics. It only see ".SetXY" So if the same format is kept then when someone typed in mouse.SetXY they would see as the help (ImageIndex, value1, value2). Which would be incorrect.
There is ideal world and then there is real world.
|
|
|
Post by u9 on Nov 11, 2006 18:42:20 GMT -5
Yeah I understand how that could be a problem.
|
|
|
Post by hartnell on Nov 13, 2006 2:37:07 GMT -5
imagine you have alot of routines that check the state of the mouse button. Without mouse locking you'd have to extend them all. Secondly, with mouse locking, you can lock the mouse in a specific state.
-hartnell
|
|