diff options
author | Quentin Wenger <matpi@protonmail.ch> | 2015-05-27 18:17:54 +0300 |
---|---|---|
committer | Jorge Bernal <jbernalmartinez@gmail.com> | 2015-05-27 18:18:43 +0300 |
commit | be4d34ca863757528deb9968578045737fecf868 (patch) | |
tree | 340fdc890717b5116624b0279a74e8a0b529a16c /doc/python_api | |
parent | 9fc1033429bffbaa9fa3bea106e9f5a4c5a3cf65 (diff) |
BGE Python API: Completing doc for bge.types.KX_FontObject
This adds description of the Font object and about its (only one)
attribute, as well as an example of use.
Reviewers: campbellbarton, fsiddi, dfelinto, moguri
Reviewed By: dfelinto
Subscribers: lordloki
Projects: #documentation, #game_engine
Differential Revision: https://developer.blender.org/D863
Diffstat (limited to 'doc/python_api')
-rw-r--r-- | doc/python_api/rst/bge_types/bge.types.KX_FontObject.rst | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_FontObject.rst b/doc/python_api/rst/bge_types/bge.types.KX_FontObject.rst index 1961f5e3e92..ca35ff49a08 100644 --- a/doc/python_api/rst/bge_types/bge.types.KX_FontObject.rst +++ b/doc/python_api/rst/bge_types/bge.types.KX_FontObject.rst @@ -7,6 +7,26 @@ base class --- :class:`KX_GameObject` .. class:: KX_FontObject(KX_GameObject) - TODO. + A Font object. + .. code-block:: python + + # Display a message about the exit key using a Font object. + import bge + + co = bge.logic.getCurrentController() + font = co.owner + + exit_key = bge.events.EventToString(bge.logic.getExitKey()) + + if exit_key.endswith("KEY"): + exit_key = exit_key[:-3] + + font.text = "Press key '%s' to quit the game." % exit_key + + .. attribute:: text + + The text displayed by this Font object. + + :type: string |