Class SCA_MouseSensor (2.48)


Methods
getXPosition
getYPosition
 
Variables
---------- ----------
 
Constants
---------- ----------

Inherited Methods:  Class SCA_ISensor
getFrequency reset
getInvert setFrequency
getLevel setInvert
getUseNegPulseMode setLevel
getUsePosPulseMode setUseNegPulseMode
isPositive setUsePosPulseMode
isTriggered ----------

Inherited Methods:  Class SCA_ILogicBrick
getExecutePriority setExecutePriority
getOwner ----------

Inherited Methods:  Class PyObjectPlus
isA ----------

Inherited Methods:  Class Value
getName ----------



Methods



getXPosition

getXPosition()

Returns the X position of the mouse pointer on the game window.

Return Type:  integer

Sample Code

# get the controller
controller = GameLogic.getCurrentController()

# get sensor named MouseOver attached to the controller
mouse = controller.getSensor("MouseOver")

# get mouse x position
xPos = mouse.getXPosition()

getYPosition

getYPosition()

Returns the Y position of the mouse pointer on the game window.

Return Type:  integer

Sample Code

# get the controller
controller = GameLogic.getCurrentController()

# get sensor named MouseOver attached to the controller
mouse = controller.getSensor("MouseOver")

# get mouse y position
xPos = mouse.getYPosition()



Blender 3D
Game Engine