Module MyGameActiveParts :: Class MY_GameGauge
[hide private]
[frames] | no frames]

Class MY_GameGauge

source code

MyGameObjects.MY_GameObjectActiveHidden --+
                                          |
                                         MY_GameGauge

class of the gauge elements, like inventory, health etc.

Instance Methods [hide private]
 
__init__(self, scene, element, text=False) source code
 
setText(self)
sets the text to be displayed in the player's gauge
source code
 
setVisible(self, visible)
sets the visibility of a gauge item
source code
 
setPosition(self, position)
sets the world position
source code
    Inherited from MyGameObjects.MY_GameObjectActiveHidden
 
deleteObject(self)
deletes object, removes it from the scene and frees its id
source code
Boolean
getAlive(self, prota_pos)
checks if object's lifetime is expired or object is out of game view
source code
Vector
getPosition(self)
gets the world position
source code
 
setLinearVelocity(self, speed, local=True)
just a forwarding of the blender setLinearVelocity
source code
Instance Variables [hide private]
String name
the name that represents the object in MY_SingleScene
String or Integer theText
the text the gauge shall display (Integer for gauge_num and String for gauge_text)
    Inherited from MyGameObjects.MY_GameObjectActiveHidden
Integer elementId
the unique identifier for this object
KX_GameObject gObject
a blender game object
Integer lifeTime
specifies the lifetime of the spawned item (negative = infinite)
String type
a name which identifies the object as a specific class in MY_SingleScene
Integer (0,1,2) worldPlane
the number of the its current plane
Method Details [hide private]

__init__(self, scene, element, text=False)
(Constructor)

source code 
Parameters:
  • scene (KX_Scene) - the blender scene object which holds all objects
  • text (Boolean) - True if it is a text otherwise it is a number
Overrides: MyGameObjects.MY_GameObjectActiveHidden.__init__

setVisible(self, visible)

source code 

sets the visibility of a gauge item

Parameters:
  • visible (Boolean) - sets the visibility of the text (True = visible; False = not visible)

setPosition(self, position)

source code 

sets the world position

Parameters:
  • position (Vector) - the new world position of the text