mirror of
https://github.com/godotengine/godot-docs.git
synced 2025-12-31 17:49:03 +03:00
127 lines
11 KiB
ReStructuredText
127 lines
11 KiB
ReStructuredText
.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
|
|
.. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
|
|
|
|
.. _class_BitmapFont:
|
|
|
|
BitmapFont
|
|
==========
|
|
|
|
**Inherits:** :ref:`Font<class_font>` **<** :ref:`Resource<class_resource>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
|
|
|
|
**Category:** Core
|
|
|
|
Brief Description
|
|
-----------------
|
|
|
|
|
|
|
|
Member Functions
|
|
----------------
|
|
|
|
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`add_char<class_BitmapFont_add_char>` **(** :ref:`int<class_int>` character, :ref:`int<class_int>` texture, :ref:`Rect2<class_rect2>` rect, :ref:`Vector2<class_vector2>` align=Vector2(0, 0), :ref:`float<class_float>` advance=-1 **)** |
|
|
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`add_kerning_pair<class_BitmapFont_add_kerning_pair>` **(** :ref:`int<class_int>` char_a, :ref:`int<class_int>` char_b, :ref:`int<class_int>` kerning **)** |
|
|
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`add_texture<class_BitmapFont_add_texture>` **(** :ref:`Texture<class_texture>` texture **)** |
|
|
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`clear<class_BitmapFont_clear>` **(** **)** |
|
|
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`create_from_fnt<class_BitmapFont_create_from_fnt>` **(** :ref:`String<class_string>` path **)** |
|
|
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Vector2<class_vector2>` | :ref:`get_char_size<class_BitmapFont_get_char_size>` **(** :ref:`int<class_int>` char, :ref:`int<class_int>` next=0 **)** const |
|
|
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Object<class_object>` | :ref:`get_fallback<class_BitmapFont_get_fallback>` **(** **)** const |
|
|
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_kerning_pair<class_BitmapFont_get_kerning_pair>` **(** :ref:`int<class_int>` char_a, :ref:`int<class_int>` char_b **)** const |
|
|
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Texture<class_texture>` | :ref:`get_texture<class_BitmapFont_get_texture>` **(** :ref:`int<class_int>` idx **)** const |
|
|
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_texture_count<class_BitmapFont_get_texture_count>` **(** **)** const |
|
|
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_ascent<class_BitmapFont_set_ascent>` **(** :ref:`float<class_float>` px **)** |
|
|
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_distance_field_hint<class_BitmapFont_set_distance_field_hint>` **(** :ref:`bool<class_bool>` enable **)** |
|
|
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_fallback<class_BitmapFont_set_fallback>` **(** :ref:`Object<class_object>` fallback **)** |
|
|
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_height<class_BitmapFont_set_height>` **(** :ref:`float<class_float>` px **)** |
|
|
+--------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Member Function Description
|
|
---------------------------
|
|
|
|
.. _class_BitmapFont_add_char:
|
|
|
|
- void **add_char** **(** :ref:`int<class_int>` character, :ref:`int<class_int>` texture, :ref:`Rect2<class_rect2>` rect, :ref:`Vector2<class_vector2>` align=Vector2(0, 0), :ref:`float<class_float>` advance=-1 **)**
|
|
|
|
Add a character to the font, where *character* is the unicode value, *texture* is the texture index, *rect* is the region in the texture (in pixels!), *align* is the (optional) alignment for the character and *advance* is the (optional) advance.
|
|
|
|
.. _class_BitmapFont_add_kerning_pair:
|
|
|
|
- void **add_kerning_pair** **(** :ref:`int<class_int>` char_a, :ref:`int<class_int>` char_b, :ref:`int<class_int>` kerning **)**
|
|
|
|
Add a kerning pair to the :ref:`BitmapFont<class_bitmapfont>` as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character.
|
|
|
|
.. _class_BitmapFont_add_texture:
|
|
|
|
- void **add_texture** **(** :ref:`Texture<class_texture>` texture **)**
|
|
|
|
Add a texture to the :ref:`BitmapFont<class_bitmapfont>`.
|
|
|
|
.. _class_BitmapFont_clear:
|
|
|
|
- void **clear** **(** **)**
|
|
|
|
Clear all the font data.
|
|
|
|
.. _class_BitmapFont_create_from_fnt:
|
|
|
|
- :ref:`int<class_int>` **create_from_fnt** **(** :ref:`String<class_string>` path **)**
|
|
|
|
.. _class_BitmapFont_get_char_size:
|
|
|
|
- :ref:`Vector2<class_vector2>` **get_char_size** **(** :ref:`int<class_int>` char, :ref:`int<class_int>` next=0 **)** const
|
|
|
|
Return the size of a character, optionally taking kerning into account if the next character is provided.
|
|
|
|
.. _class_BitmapFont_get_fallback:
|
|
|
|
- :ref:`Object<class_object>` **get_fallback** **(** **)** const
|
|
|
|
.. _class_BitmapFont_get_kerning_pair:
|
|
|
|
- :ref:`int<class_int>` **get_kerning_pair** **(** :ref:`int<class_int>` char_a, :ref:`int<class_int>` char_b **)** const
|
|
|
|
Return a kerning pair as a difference.
|
|
|
|
.. _class_BitmapFont_get_texture:
|
|
|
|
- :ref:`Texture<class_texture>` **get_texture** **(** :ref:`int<class_int>` idx **)** const
|
|
|
|
.. _class_BitmapFont_get_texture_count:
|
|
|
|
- :ref:`int<class_int>` **get_texture_count** **(** **)** const
|
|
|
|
.. _class_BitmapFont_set_ascent:
|
|
|
|
- void **set_ascent** **(** :ref:`float<class_float>` px **)**
|
|
|
|
Set the font ascent (number of pixels above the baseline).
|
|
|
|
.. _class_BitmapFont_set_distance_field_hint:
|
|
|
|
- void **set_distance_field_hint** **(** :ref:`bool<class_bool>` enable **)**
|
|
|
|
.. _class_BitmapFont_set_fallback:
|
|
|
|
- void **set_fallback** **(** :ref:`Object<class_object>` fallback **)**
|
|
|
|
.. _class_BitmapFont_set_height:
|
|
|
|
- void **set_height** **(** :ref:`float<class_float>` px **)**
|
|
|
|
Set the total font height (ascent plus descent) in pixels.
|
|
|
|
|