Ive done it before but i don’t remember How to do it anymore.
isn’t it python?
yes. you can read the tut on the cursor here:
http://www.blendenzo.com/indexTuts.html
You’re right. It’s python.
import Rasterizer
Rasterizer.showMouse(True)
Thank you.
Well, you should do what it told you to do. Check the console and see what it is telling you. Usually you can read the error there and find out what the problem is.
To save you the effort, though, change the value “True” to 1 instead. Python scripts in the Blender GE don’t know what “True” and “False” are for some reason. 1 and 0 should be used instead (even when you are changing the value of a Blender boolean property).
its the import rasterizer that has the problem and changing it to 1 does nothing
On any object in your scene, let’s say “Camera”, hook up an “always” sensor and a “Controller” (select “Python” controller) and name it “mouse”. Now in the text editor, where the above script should be, title that “mouse”. This should work. Of course you can toggle the mouse on and off many other ways as well. "showMouse(1) is on. "showMouse(0) is off. I usually use 2 separate scripts. I’m not a programmer, nor do I know more than the basics of Python.
Hope it helps.
Look at this example… It should help
Out of curiosity, is there a simple script that you can use to toggle the mouse on/off? As I stated above, I always use two separate scripts. (ie: Hit space bar twice; on/off). You don’t have to answer, I’ve seen an example that I can probably modify and make work, I just haven’t tried it yet.
Nice website, BTW. I just downloaded your demos.
the always sensor should have pulse off so it only happen once.
Give the object that the script is on a boolean property called mouseVisible or something like that. Then hook the following script to a Keyboard: Spacebar sensor (named Spacebar in the code).
import Rasterizer
cont = GameLogic.getCurrentController()
own = cont.getOwner()
spacebar = cont.getSensor("Spacebar")
# Check to see if the spacebar keyboard event is sending a "positive" pulse
# That means it was just pressed (provided positive pulse mode is turned off).
if spacebar.isPositive():
# Check the value of mouseVisible and switch it
if own.mouseVisibile == 1:
own.mouseVisible = 0
else:
own.mouseVisible = 1
# Set showMouse() to the current value of mouseVisible
Rasterizer.showMouse(own.mouseVisible)
Thanks a bunch, blendenzo. That saved me a lot of time. It’s funny, I can modify code, but I’m always at a complete loss on how to write my own. I added a couple of lines to make the mouse come on when the scene starts. I guess it’s right???
For what I plan on using it for however, I now think it would be best two use two separate scripts to turn the mouse on/off. It might prove useful in the future though.
import Rasterizer
cont = GameLogic.getCurrentController()
own = cont.getOwner()
spacebar = cont.getSensor("Spacebar")
<b>mouseon = cont.getSensor("mouseon")
if mouseon.isPositive():
Rasterizer.showMouse(1)</b>
# Check to see if the spacebar keyboard event is sending a "positive" pulse
# That means it was just pressed (provided positive pulse mode is turned off).
if spacebar.isPositive():
# Check the value of mouseVisible and switch it
if own.mouseVisibile == 1:
own.mouseVisible = 0
else:
own.mouseVisible = 1
# Set showMouse() to the current value of mouseVisible
Rasterizer.showMouse(own.mouseVisible)


