BGE doc cleanup: Some small cleanups in the BGE docs:

* Fixing trailing whitespace in some files
  * Fixing some indentation
  * SCA_PythonController.owner is now documented
  * SCA_PythonKeyboard members now use the member directive instead of function
This commit is contained in:
Mitchell Stokes 2014-03-31 22:20:03 -07:00
parent 617557b08e
commit 11299f5ff4
6 changed files with 96 additions and 90 deletions

@ -78,7 +78,7 @@ Physics Constraints (bge.constraints)
:return: a vehicle constraint object.
:rtype: :class:`bge.types.KX_VehicleWrapper`
.. function:: getCharacter(gameobj)
:arg gameobj: The game object with the character physics.
@ -237,101 +237,101 @@ Physics Constraints (bge.constraints)
Not implemented.
.. data:: DBG_NODEBUG
.. note::
Debug mode to be used with function :class:`setDebugMode`
No debug.
.. data:: DBG_DRAWWIREFRAME
.. note::
Debug mode to be used with function :class:`setDebugMode`
Draw wireframe in debug.
.. data:: DBG_DRAWAABB
.. note::
Debug mode to be used with function :class:`setDebugMode`
Draw Axis Aligned Bounding Box in debug.
.. data:: DBG_DRAWFREATURESTEXT
.. note::
Debug mode to be used with function :class:`setDebugMode`
Draw freatures text in debug.
.. data:: DBG_DRAWCONTACTPOINTS
.. note::
Debug mode to be used with function :class:`setDebugMode`
Draw contact points in debug.
.. data:: DBG_NOHELPTEXT
.. note::
Debug mode to be used with function :class:`setDebugMode`
Debug without help text.
.. data:: DBG_DRAWTEXT
.. note::
Debug mode to be used with function :class:`setDebugMode`
Draw text in debug.
.. data:: DBG_PROFILETIMINGS
.. note::
Debug mode to be used with function :class:`setDebugMode`
Draw profile timings in debug.
.. data:: DBG_ENABLESATCOMPARISION
.. note::
Debug mode to be used with function :class:`setDebugMode`
Enable sat comparision in debug.
.. data:: DBG_DISABLEBULLETLCP
.. note::
Debug mode to be used with function :class:`setDebugMode`
Disable Bullet LCP.
.. data:: DBG_ENABLECCD
.. note::
Debug mode to be used with function :class:`setDebugMode`
Enable Continous Colision Detection in debug.
.. data:: DBG_DRAWCONSTRAINTS
.. note::
Debug mode to be used with function :class:`setDebugMode`
Draw constraints in debug.
.. data:: DBG_DRAWCONSTRAINTLIMITS
.. note::
Debug mode to be used with function :class:`setDebugMode`
Draw constraint limits in debug.
.. data:: DBG_FASTWIREFRAME
.. note::
Debug mode to be used with function :class:`setDebugMode`
Draw a fast wireframe in debug.
.. data:: POINTTOPOINT_CONSTRAINT

@ -14,7 +14,7 @@ This module holds key constants for the SCA_KeyboardSensor.
# Set a connected keyboard sensor to accept F1
import bge
co = bge.logic.getCurrentController()
# 'Keyboard' is a keyboard sensor
sensor = co.sensors["Keyboard"]
@ -24,7 +24,7 @@ This module holds key constants for the SCA_KeyboardSensor.
# Do the all keys thing
import bge
co = bge.logic.getCurrentController()
# 'Keyboard' is a keyboard sensor
sensor = co.sensors["Keyboard"]
@ -46,20 +46,20 @@ This module holds key constants for the SCA_KeyboardSensor.
# The all keys thing without a keyboard sensor (but you will
# need an always sensor with pulse mode on)
import bge
# Just shortening names here
keyboard = bge.logic.keyboard
JUST_ACTIVATED = bge.logic.KX_INPUT_JUST_ACTIVATED
if keyboard.events[bge.events.WKEY] == JUST_ACTIVATED:
print("Activate Forward!")
if keyboard.events[bge.events.SKEY] == JUST_ACTIVATED:
print("Activate Backward!")
print("Activate Backward!")
if keyboard.events[bge.events.AKEY] == JUST_ACTIVATED:
print("Activate Left!")
print("Activate Left!")
if keyboard.events[bge.events.DKEY] == JUST_ACTIVATED:
print("Activate Right!")
*********
Functions
@ -72,11 +72,11 @@ Functions
:arg event: key event constant from :mod:`bge.events` or the keyboard sensor.
:type event: int
:rtype: string
.. function:: EventToCharacter(event, shift)
Return the string name of a key event. Returns an empty string if the event cant be represented as a character.
:type event: int
:arg event: key event constant from :mod:`bge.events` or the keyboard sensor.
:type shift: bool

@ -34,7 +34,7 @@ base class --- :class:`PyObjectPlus`
:type: int
.. attribute:: walkDirection
The speed and direction the character is traveling in using world coordinates. This should be used instead of applyMovement() to properly move the character.
:type: list [x, y, z]

@ -12,7 +12,7 @@ base class --- :class:`SCA_IObject`
Properties assigned to game objects are accessible as attributes of this class.
.. note::
Calling ANY method or attribute on an object that has been removed from a scene will raise a SystemError,
if an object may have been removed since last accessing it use the :data:`invalid` attribute to check.
@ -75,25 +75,25 @@ base class --- :class:`SCA_IObject`
:type: float
.. note::
The object must have a physics controller for the mass to be applied, otherwise the mass value will be returned as 0.0.
.. attribute:: linVelocityMin
Enforces the object keeps moving at a minimum velocity.
:type: float
.. note::
Applies to dynamic and rigid body objects only.
.. note::
A value of 0.0 disables this option.
.. note::
While objects are stationary the minimum velocity will not be applied.
.. attribute:: linVelocityMax
@ -101,9 +101,9 @@ base class --- :class:`SCA_IObject`
Clamp the maximum linear velocity to prevent objects moving beyond a set speed.
:type: float
.. note::
Applies to dynamic and rigid body objects only.
.. note::
@ -247,25 +247,25 @@ base class --- :class:`SCA_IObject`
:type: :class:`mathutils.Matrix`
.. attribute:: localLinearVelocity
The object's local linear velocity. [x, y, z]
:type: :class:`mathutils.Vector`
.. attribute:: worldLinearVelocity
The object's world linear velocity. [x, y, z]
:type: :class:`mathutils.Vector`
.. attribute:: localAngularVelocity
The object's local angular velocity. [x, y, z]
:type: :class:`mathutils.Vector`
.. attribute:: worldAngularVelocity
The object's world angular velocity. [x, y, z]
:type: :class:`mathutils.Vector`
@ -287,13 +287,13 @@ base class --- :class:`SCA_IObject`
a list meshes for this object.
:type: list of :class:`KX_MeshProxy`
.. note::
Most objects use only 1 mesh.
.. note::
Changes to this list will not update the KX_GameObject.
.. attribute:: sensors
@ -301,13 +301,13 @@ base class --- :class:`SCA_IObject`
a sequence of :class:`SCA_ISensor` objects with string/index lookups and iterator support.
:type: list
.. note::
This attribute is experemental and may be removed (but probably wont be).
.. note::
Changes to this list will not update the KX_GameObject.
.. attribute:: controllers
@ -315,13 +315,13 @@ base class --- :class:`SCA_IObject`
a sequence of :class:`SCA_IController` objects with string/index lookups and iterator support.
:type: list of :class:`SCA_ISensor`
.. note::
This attribute is experemental and may be removed (but probably wont be).
.. note::
Changes to this list will not update the KX_GameObject.
.. attribute:: actuators
@ -329,7 +329,7 @@ base class --- :class:`SCA_IObject`
a list of :class:`SCA_IActuator` with string/index lookups and iterator support.
:type: list
.. note::
This attribute is experemental and may be removed (but probably wont be).
@ -490,7 +490,7 @@ base class --- :class:`SCA_IObject`
Sets the game object's linear velocity.
This method sets game object's velocity through it's centre of mass,
This method sets game object's velocity through it's centre of mass,
ie no angular velocity component.
This requires a dynamic object.
@ -571,7 +571,7 @@ base class --- :class:`SCA_IObject`
Resumes physics for this object.
.. note::
The objects linear velocity will be applied from when the dynamics were suspended.
.. method:: enableRigidBody()
@ -607,7 +607,7 @@ base class --- :class:`SCA_IObject`
:type ghost: boolean
.. note::
If the object type is sensor, it stays ghost regardless of ghost parameter
.. method:: removeParent()
@ -724,7 +724,7 @@ base class --- :class:`SCA_IObject`
* or 5-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz), :class:`KX_PolyProxy`, 2-tuple (u, v))
.. note::
The ray ignores the object on which the method is called. It is casted from/to object center or explicit [x, y, z] points.
.. method:: setCollisionMargin(margin)
@ -735,7 +735,7 @@ base class --- :class:`SCA_IObject`
:type margin: float
.. note::
If this object has no physics controller (a physics ID of zero), this function will raise RuntimeError.
.. method:: sendMessage(subject, body="", to="")
@ -766,11 +766,11 @@ base class --- :class:`SCA_IObject`
.. note::
If this object has instances the other instances will be updated too.
.. note::
The gameObject argument has an advantage that it can convert from a mesh with modifiers applied (such as subsurf).
.. warning::
Only triangle mesh type objects are supported currently (not convex hull)
@ -791,7 +791,7 @@ base class --- :class:`SCA_IObject`
.. method:: playAction(name, start_frame, end_frame, layer=0, priority=0, blendin=0, play_mode=KX_ACTION_MODE_PLAY, layer_weight=0.0, ipo_flags=0, speed=1.0, blend_mode=KX_ACTION_BLEND_BLEND)
Plays an action.
:arg name: the name of the action
:type name: string
:arg start: the start frame of the action
@ -812,42 +812,42 @@ base class --- :class:`SCA_IObject`
:type ipo_flags: int bitfield
:arg speed: the playback speed of the action as a factor (1.0 = normal speed, 2.0 = 2x speed, etc)
:type speed: float
:arg blend_mode: how to blend this layer with previous layers
:type blend_mode: one of :ref:`these constants <gameobject-playaction-blend>`
:arg blend_mode: how to blend this layer with previous layers
:type blend_mode: one of :ref:`these constants <gameobject-playaction-blend>`
.. method:: stopAction(layer=0)
Stop playing the action on the given layer.
:arg layer: The layer to stop playing.
:type layer: integer
.. method:: getActionFrame(layer=0)
Gets the current frame of the action playing in the supplied layer.
:arg layer: The layer that you want to get the frame from.
:type layer: integer
:return: The current frame of the action
:rtype: float
.. method:: setActionFrame(frame, layer=0)
Set the current frame of the action playing in the supplied layer.
:arg layer: The layer where you want to set the frame
:type layer: integer
:arg frame: The frame to set the action to
:type frame: float
.. method:: isPlayingAction(layer=0)
Checks to see if there is an action playing in the given layer.
:arg layer: The layer to check for a playing action.
:type layer: integer
:return: Whether or not the action is playing
:rtype: boolean
Checks to see if there is an action playing in the given layer.
:arg layer: The layer to check for a playing action.
:type layer: integer
:return: Whether or not the action is playing
:rtype: boolean

@ -10,6 +10,12 @@ base class --- :class:`SCA_IController`
A Python controller uses a Python script to activate it's actuators,
based on it's sensors.
.. attribute:: owner
The object the controller is attached to.
:type: :class:`KX_GameObject`
.. attribute:: script
The value of this variable depends on the execution methid.

@ -22,13 +22,13 @@ base class --- :class:`PyObjectPlus`
:type: dictionary {:ref:`keycode<keyboard-keys>`::ref:`status<input-status>`, ...}
.. function:: getClipboard()
.. method:: getClipboard()
Gets the clipboard text.
:rtype: string
.. function:: setClipboard(text)
.. method:: setClipboard(text)
Sets the clipboard text.