Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2008-06-30 01:52:23 +0400
committerCampbell Barton <ideasman42@gmail.com>2008-06-30 01:52:23 +0400
commit6a3e8e7fff4e577bea02966546293760c19deec7 (patch)
tree1b5033f3a49fba5443d6413c700862b1e8b17540 /source/gameengine/PyDoc
parentab7794392e9708ddbba24d9b444f61c06b19099b (diff)
BGE python api addition, GameObject get/setState and Controller.getState()
Also added a note in the tooltip for action priority when using more then 1 action at a time.
Diffstat (limited to 'source/gameengine/PyDoc')
-rw-r--r--source/gameengine/PyDoc/KX_GameObject.py14
-rw-r--r--source/gameengine/PyDoc/SCA_PythonController.py8
2 files changed, 22 insertions, 0 deletions
diff --git a/source/gameengine/PyDoc/KX_GameObject.py b/source/gameengine/PyDoc/KX_GameObject.py
index f971a7f5f54..ec7496daa75 100644
--- a/source/gameengine/PyDoc/KX_GameObject.py
+++ b/source/gameengine/PyDoc/KX_GameObject.py
@@ -42,6 +42,20 @@ class KX_GameObject:
@type visible: boolean
"""
+ def getState():
+ """
+ Gets the game object's state bitmask.
+
+ @rtype: int
+ @return: the objects state.
+ """
+ def setState():
+ """
+ Sets the game object's visible flag.
+ The bitmasks for states from 1 to 30 can be set with (1<<0, 1<<1, 1<<2 ... 1<<29)
+
+ @type visible: boolean
+ """
def setPosition(pos):
"""
Sets the game object's position.
diff --git a/source/gameengine/PyDoc/SCA_PythonController.py b/source/gameengine/PyDoc/SCA_PythonController.py
index eb9e57c0819..6d91736d636 100644
--- a/source/gameengine/PyDoc/SCA_PythonController.py
+++ b/source/gameengine/PyDoc/SCA_PythonController.py
@@ -46,4 +46,12 @@ class SCA_PythonController(SCA_IController):
@type script: string.
"""
+ def getState():
+ """
+ Get the controllers state bitmask, this can be used with the GameObject's state to test if the the controller is active.
+ This for instance will always be true however you could compare with a previous state to see when the state was activated.
+ GameLogic.getCurrentController().getState() & GameLogic.getCurrentController().getOwner().getState()
+
+ @rtype: int
+ """