From 6a3e8e7fff4e577bea02966546293760c19deec7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 29 Jun 2008 21:52:23 +0000 Subject: 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. --- source/gameengine/PyDoc/KX_GameObject.py | 14 ++++++++++++++ source/gameengine/PyDoc/SCA_PythonController.py | 8 ++++++++ 2 files changed, 22 insertions(+) (limited to 'source/gameengine/PyDoc') 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 @@ -40,6 +40,20 @@ class KX_GameObject: """ Sets the game object's visible flag. + @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): 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 + """ -- cgit v1.2.3