Blender 3D: Noob to Pro/Basic mouse pointer
Applicable Blender version: 2.49. |
Mouse Pointer
editMaking a simple mouse pointer in the game engine. This takes up a lot of resources but it is very simple.
A little Python is involved but it is very easy to use and is only 2 lines of code.
- Open up blender and split the screen in two.
- Make the right screen a text editor and add a new text file with ALT+N. Type in the following code.
import Rasterizer as r r.showMouse(1)
- Set TX: showpointer in the middle of the Text panel menu bar.
- Select an object that will always be available - preferably a camera.
- Go to the logic tab, add a "Property" sensor, a "Python" controller, an "AND" controller and a "Property" actuator.
- Activate the True Level Triggering (the “‘ button), set Prop: switch and Value: 0. Connect the property sensor to the python and AND controllers by dragging lines between the bullets.
- For the python controller set Script: showpointer. Note: If the value keeps being reverted to blank after setting it, the name you entered is not a legal script name; chances are you did not set the name of your script correctly. Look for the selection menu beginning with "TX:" and make sure it says TX:showpointer.
- Now connect the AND controller to the property actuator. Set Prop: switch and Value: 1.
- Select Actor and click on Add Property make it a Int type and set Name:switch.
Now press P to start the game and now you`ll see your mouse pointer.