Mouse questions
by Paul Fountain · in Torque Game Builder · 04/16/2006 (11:24 pm) · 2 replies
First post, I bought TGB about a week ago and I have been working through the tutorials, and I'm getting to the point where my simple game idea is starting to come to life. I have two questions about mouse handling:
1. There is a setMousePosition() function but from doing a search of the forums, it appears that it does not work currently. My quick tests in my game would seem to back that up. Anyone know the current status?
2. Is there any way to turn off the mouse cursor? A form search turned up CursorOn and CursorOff functions, but these are not in the reference docs that came with TGB.
1. There is a setMousePosition() function but from doing a search of the forums, it appears that it does not work currently. My quick tests in my game would seem to back that up. Anyone know the current status?
2. Is there any way to turn off the mouse cursor? A form search turned up CursorOn and CursorOff functions, but these are not in the reference docs that came with TGB.
About the author
#2
I put a blank.gif in my images directory, a 1x1 transparent .gif file.
I do have Beta 2 of TGB, but the setMousePosition() function doesn't seem to work. Basically it doesn't do anything for me. I'll have to look into that more later. Everything else is going well, at this point I have created a basic working shell of the (very very) old arcade game "Rampart". I just followed the Tetris tutorial, and started throwing in my own code where appropriate. Now for the hard stuff like scoring, and detecting when the player creates a closed loop with his blocks ...
04/17/2006 (8:07 pm)
Thanks, Luke ... this code worked for making the mouse cursor disappear:DefaultCursor.bitmapName = "~/data/images/blank";
I put a blank.gif in my images directory, a 1x1 transparent .gif file.
I do have Beta 2 of TGB, but the setMousePosition() function doesn't seem to work. Basically it doesn't do anything for me. I'll have to look into that more later. Everything else is going well, at this point I have created a basic working shell of the (very very) old arcade game "Rampart". I just followed the Tetris tutorial, and started throwing in my own code where appropriate. Now for the hard stuff like scoring, and detecting when the player creates a closed loop with his blocks ...
Torque 3D Owner Luke D
Default Studio Name
Using Canvas.cursorOn and Canvas.cursorOff totally turns off the mouse and will stop mouse even callbacks from happening. They're part of the core TGE engine and hence not in the TGB reference documentation.
What it sounds like you really want is either Canvas.showCursor() and Canvas.hideCursor(), or Canvas.setCursor(