mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-04 10:09:56 +03:00
Currently including `zh_CN` and `es` which both have very high completion ratios. Others will be added once they reach a significant percentage too. These RST files will be used by godot-docs in place of its `classes` folder after we sync with https://github.com/godotengine/godot-docs/pull/5458. The update workflow is manual for now (example for `zh_CN`): - Build `godotengine/godot` in the branch we currently track (now `3.x`) - Run `godot --doctool -l zh_CN` - Run `cd doc && make rst LANGARG=zh_CN` - Copy `doc/_build/rst/*` to `classes/zh_CN/` here - Make sure to have `classes/zh_CN/index.rst` copied from `docs/classes`
188 lines
11 KiB
ReStructuredText
188 lines
11 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
|
.. DO NOT EDIT THIS FILE, but the BitmapFont.xml source instead.
|
|
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
|
|
|
.. _class_BitmapFont:
|
|
|
|
BitmapFont
|
|
==========
|
|
|
|
**Inherits:** :ref:`Font<class_Font>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
|
|
|
|
Renderiza el texto usando fuentes en el formato `BMFont <https://www.angelcode.com/products/bmfont/>`__.
|
|
|
|
Maneja archivos con la extensión ``.fnt``.
|
|
|
|
Descripción
|
|
----------------------
|
|
|
|
Presenta el texto usando fuentes ``*.fnt`` que contienen atlas de texturas. Soporta campos de distancia. Para usar directamente archivos de fuentes vectoriales como TTF, ver :ref:`DynamicFont<class_DynamicFont>`.
|
|
|
|
Propiedades
|
|
----------------------
|
|
|
|
+-------------------------------------+-----------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`ascent<class_BitmapFont_property_ascent>` | ``0.0`` |
|
|
+-------------------------------------+-----------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`distance_field<class_BitmapFont_property_distance_field>` | ``false`` |
|
|
+-------------------------------------+-----------------------------------------------------------------+-----------+
|
|
| :ref:`BitmapFont<class_BitmapFont>` | :ref:`fallback<class_BitmapFont_property_fallback>` | |
|
|
+-------------------------------------+-----------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`height<class_BitmapFont_property_height>` | ``1.0`` |
|
|
+-------------------------------------+-----------------------------------------------------------------+-----------+
|
|
|
|
Métodos
|
|
--------------
|
|
|
|
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`add_char<class_BitmapFont_method_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_method_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_method_add_texture>` **(** :ref:`Texture<class_Texture>` texture **)** |
|
|
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`clear<class_BitmapFont_method_clear>` **(** **)** |
|
|
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`create_from_fnt<class_BitmapFont_method_create_from_fnt>` **(** :ref:`String<class_String>` path **)** |
|
|
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_kerning_pair<class_BitmapFont_method_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_method_get_texture>` **(** :ref:`int<class_int>` idx **)** |const| |
|
|
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_texture_count<class_BitmapFont_method_get_texture_count>` **(** **)** |const| |
|
|
+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Descripciones de Propiedades
|
|
--------------------------------------------------------
|
|
|
|
.. _class_BitmapFont_property_ascent:
|
|
|
|
- :ref:`float<class_float>` **ascent**
|
|
|
|
+-----------+-------------------+
|
|
| *Default* | ``0.0`` |
|
|
+-----------+-------------------+
|
|
| *Setter* | set_ascent(value) |
|
|
+-----------+-------------------+
|
|
| *Getter* | get_ascent() |
|
|
+-----------+-------------------+
|
|
|
|
Ascenso (número de píxeles por encima de la línea de base).
|
|
|
|
----
|
|
|
|
.. _class_BitmapFont_property_distance_field:
|
|
|
|
- :ref:`bool<class_bool>` **distance_field**
|
|
|
|
+-----------+--------------------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+--------------------------------+
|
|
| *Setter* | set_distance_field_hint(value) |
|
|
+-----------+--------------------------------+
|
|
| *Getter* | is_distance_field_hint() |
|
|
+-----------+--------------------------------+
|
|
|
|
Si ``true``, la sugerencia de campo de distancia está activada.
|
|
|
|
----
|
|
|
|
.. _class_BitmapFont_property_fallback:
|
|
|
|
- :ref:`BitmapFont<class_BitmapFont>` **fallback**
|
|
|
|
+----------+---------------------+
|
|
| *Setter* | set_fallback(value) |
|
|
+----------+---------------------+
|
|
| *Getter* | get_fallback() |
|
|
+----------+---------------------+
|
|
|
|
La fuente alternativa.
|
|
|
|
----
|
|
|
|
.. _class_BitmapFont_property_height:
|
|
|
|
- :ref:`float<class_float>` **height**
|
|
|
|
+-----------+-------------------+
|
|
| *Default* | ``1.0`` |
|
|
+-----------+-------------------+
|
|
| *Setter* | set_height(value) |
|
|
+-----------+-------------------+
|
|
| *Getter* | get_height() |
|
|
+-----------+-------------------+
|
|
|
|
Altura total de la fuente (ascenso más descenso) en píxeles.
|
|
|
|
Descripciones de Métodos
|
|
------------------------------------------------
|
|
|
|
.. _class_BitmapFont_method_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 **)**
|
|
|
|
Añade un carácter a la fuente, donde ``character`` es el valor Unicode, ``texture`` es el índice de la textura, ``rect`` es la región de la textura (¡en píxeles!), ``align`` es la alineación (opcional) del carácter y ``advance`` es el avance (opcional).
|
|
|
|
----
|
|
|
|
.. _class_BitmapFont_method_add_kerning_pair:
|
|
|
|
- void **add_kerning_pair** **(** :ref:`int<class_int>` char_a, :ref:`int<class_int>` char_b, :ref:`int<class_int>` kerning **)**
|
|
|
|
Añade un par de kerning a la ``BitmapFont`` como diferencia. Los pares de Kerning son casos especiales en los que el avance de un tipo de letra viene determinado por el siguiente carácter.
|
|
|
|
----
|
|
|
|
.. _class_BitmapFont_method_add_texture:
|
|
|
|
- void **add_texture** **(** :ref:`Texture<class_Texture>` texture **)**
|
|
|
|
Añade una textura al ``BitmapFont``.
|
|
|
|
----
|
|
|
|
.. _class_BitmapFont_method_clear:
|
|
|
|
- void **clear** **(** **)**
|
|
|
|
Borra todos los datos y ajustes de la fuente.
|
|
|
|
----
|
|
|
|
.. _class_BitmapFont_method_create_from_fnt:
|
|
|
|
- :ref:`Error<enum_@GlobalScope_Error>` **create_from_fnt** **(** :ref:`String<class_String>` path **)**
|
|
|
|
Crea una fuente de mapa de bits a partir del archivo ``*.fnt`` en ``path``.
|
|
|
|
----
|
|
|
|
.. _class_BitmapFont_method_get_kerning_pair:
|
|
|
|
- :ref:`int<class_int>` **get_kerning_pair** **(** :ref:`int<class_int>` char_a, :ref:`int<class_int>` char_b **)** |const|
|
|
|
|
Devuelve un par de kerning como diferencia.
|
|
|
|
----
|
|
|
|
.. _class_BitmapFont_method_get_texture:
|
|
|
|
- :ref:`Texture<class_Texture>` **get_texture** **(** :ref:`int<class_int>` idx **)** |const|
|
|
|
|
Devuelve la textura de la fuente del atlas en el índice ``idx``.
|
|
|
|
----
|
|
|
|
.. _class_BitmapFont_method_get_texture_count:
|
|
|
|
- :ref:`int<class_int>` **get_texture_count** **(** **)** |const|
|
|
|
|
Devuelve el número de texturas en el atlas de BitmapFont.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
|
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
|
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|