Welcome to mirror list, hosted at ThFree Co, Russian Federation.

bge.types.KX_FontObject.rst « bge_types « rst « python_api « doc - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ca35ff49a0828ff910ffe4778cbc995928447747 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
KX_FontObject(KX_GameObject)
============================

.. module:: bge.types

base class --- :class:`KX_GameObject`

.. class:: KX_FontObject(KX_GameObject)

   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