forked from bartvdbraak/blender
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
This commit is contained in:
parent
9fc1033429
commit
be4d34ca86
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user