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:
-rw-r--r--doc/python_api/rst/bge_types/bge.types.KX_FontObject.rst22
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