forked from bartvdbraak/blender
1c663bbc7e
The principle is to replace most get/set methods of logic bricks by direct property access. To make porting of game code easier, the properties have usually the same type and use than the return values/parameters of the get/set methods. More details on http://wiki.blender.org/index.php/GameEngineDev/Python_API_Clean_Up Old methods are still available but will produce deprecation warnings on the console: "<method> is deprecated, use the <property> property instead" You can avoid these messages by turning on the "Ignore deprecation warnings" option in Game menu. PyDoc is updated to include the new properties and display a deprecation warning for the get/set methods that are being deprecated.
35 lines
1001 B
Python
35 lines
1001 B
Python
# $Id$
|
|
# Documentation for SCA_MouseSensor
|
|
from SCA_ISensor import *
|
|
|
|
class SCA_MouseSensor(SCA_ISensor):
|
|
"""
|
|
Mouse Sensor logic brick.
|
|
|
|
Properties:
|
|
|
|
@ivar position: current [x,y] coordinates of the mouse, in frame coordinates (pixels)
|
|
@type position: [integer,interger]
|
|
@ivar mode: sensor mode: 1=KX_MOUSESENSORMODE_LEFTBUTTON 2=KX_MOUSESENSORMODE_MIDDLEBUTTON
|
|
3=KX_MOUSESENSORMODE_RIGHTBUTTON 4=KX_MOUSESENSORMODE_WHEELUP
|
|
5=KX_MOUSESENSORMODE_WHEELDOWN 9=KX_MOUSESENSORMODE_MOVEMENT
|
|
@type mode: integer
|
|
"""
|
|
|
|
def getXPosition():
|
|
"""
|
|
DEPRECATED: use the position property
|
|
Gets the x coordinate of the mouse.
|
|
|
|
@rtype: integer
|
|
@return: the current x coordinate of the mouse, in frame coordinates (pixels)
|
|
"""
|
|
def getYPosition():
|
|
"""
|
|
DEPRECATED: use the position property
|
|
Gets the y coordinate of the mouse.
|
|
|
|
@rtype: integer
|
|
@return: the current y coordinate of the mouse, in frame coordinates (pixels).
|
|
"""
|