Merge pull request #12005 from diowonderland/docs-bitmapfont
[DOCS] BitmapFont
This commit is contained in:
commit
8bdb04c839
1 changed files with 23 additions and 8 deletions
|
@ -1,8 +1,10 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<class name="BitmapFont" inherits="Font" category="Core" version="3.0.alpha.custom_build">
|
<class name="BitmapFont" inherits="Font" category="Core" version="3.0.alpha.custom_build">
|
||||||
<brief_description>
|
<brief_description>
|
||||||
|
Renders text using [code]*.fnt[/code] fonts.
|
||||||
</brief_description>
|
</brief_description>
|
||||||
<description>
|
<description>
|
||||||
|
Renders text using [code]*.fnt[/code] fonts containing texture atlases. Supports distance fields. For using vector font files like TTF directly, see [DynamicFont].
|
||||||
</description>
|
</description>
|
||||||
<tutorials>
|
<tutorials>
|
||||||
</tutorials>
|
</tutorials>
|
||||||
|
@ -23,7 +25,7 @@
|
||||||
<argument index="4" name="advance" type="float" default="-1">
|
<argument index="4" name="advance" type="float" default="-1">
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Add a character to the font, where [i]character[/i] is the unicode value, [i]texture[/i] is the texture index, [i]rect[/i] is the region in the texture (in pixels!), [i]align[/i] is the (optional) alignment for the character and [i]advance[/i] is the (optional) advance.
|
Adds a character to the font, where [code]character[/code] is the unicode value, [code]texture[/code] is the texture index, [code]rect[/code] is the region in the texture (in pixels!), [code]align[/code] is the (optional) alignment for the character and [code]advance[/code] is the (optional) advance.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="add_kerning_pair">
|
<method name="add_kerning_pair">
|
||||||
|
@ -36,7 +38,7 @@
|
||||||
<argument index="2" name="kerning" type="int">
|
<argument index="2" name="kerning" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Add a kerning pair to the [BitmapFont] as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character.
|
Adds a kerning pair to the [BitmapFont] as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="add_texture">
|
<method name="add_texture">
|
||||||
|
@ -45,14 +47,14 @@
|
||||||
<argument index="0" name="texture" type="Texture">
|
<argument index="0" name="texture" type="Texture">
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Add a texture to the [BitmapFont].
|
Adds a texture to the [BitmapFont].
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="clear">
|
<method name="clear">
|
||||||
<return type="void">
|
<return type="void">
|
||||||
</return>
|
</return>
|
||||||
<description>
|
<description>
|
||||||
Clear all the font data.
|
Clears all the font data and settings.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="create_from_fnt">
|
<method name="create_from_fnt">
|
||||||
|
@ -61,6 +63,7 @@
|
||||||
<argument index="0" name="path" type="String">
|
<argument index="0" name="path" type="String">
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
|
Creates a BitmapFont from the [code]*.fnt[/code] file at [code]path[/code].
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="get_char_size" qualifiers="const">
|
<method name="get_char_size" qualifiers="const">
|
||||||
|
@ -71,13 +74,14 @@
|
||||||
<argument index="1" name="next" type="int" default="0">
|
<argument index="1" name="next" type="int" default="0">
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Return the size of a character, optionally taking kerning into account if the next character is provided.
|
Returns the size of a character, optionally taking kerning into account if the next character is provided.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="get_fallback" qualifiers="const">
|
<method name="get_fallback" qualifiers="const">
|
||||||
<return type="BitmapFont">
|
<return type="BitmapFont">
|
||||||
</return>
|
</return>
|
||||||
<description>
|
<description>
|
||||||
|
Returns the fallback BitmapFont.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="get_kerning_pair" qualifiers="const">
|
<method name="get_kerning_pair" qualifiers="const">
|
||||||
|
@ -88,7 +92,7 @@
|
||||||
<argument index="1" name="char_b" type="int">
|
<argument index="1" name="char_b" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Return a kerning pair as a difference.
|
Returns a kerning pair as a difference.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="get_texture" qualifiers="const">
|
<method name="get_texture" qualifiers="const">
|
||||||
|
@ -97,12 +101,14 @@
|
||||||
<argument index="0" name="idx" type="int">
|
<argument index="0" name="idx" type="int">
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
|
Returns the font atlas texture at index [code]idx[/code].
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="get_texture_count" qualifiers="const">
|
<method name="get_texture_count" qualifiers="const">
|
||||||
<return type="int">
|
<return type="int">
|
||||||
</return>
|
</return>
|
||||||
<description>
|
<description>
|
||||||
|
Returns the number of textures in the BitmapFont atlas.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="set_ascent">
|
<method name="set_ascent">
|
||||||
|
@ -111,7 +117,7 @@
|
||||||
<argument index="0" name="px" type="float">
|
<argument index="0" name="px" type="float">
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Set the font ascent (number of pixels above the baseline).
|
Sets the font ascent (number of pixels above the baseline).
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="set_distance_field_hint">
|
<method name="set_distance_field_hint">
|
||||||
|
@ -120,6 +126,7 @@
|
||||||
<argument index="0" name="enable" type="bool">
|
<argument index="0" name="enable" type="bool">
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
|
If [code]true[/code] distance field hint is enabled.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="set_fallback">
|
<method name="set_fallback">
|
||||||
|
@ -128,6 +135,7 @@
|
||||||
<argument index="0" name="fallback" type="BitmapFont">
|
<argument index="0" name="fallback" type="BitmapFont">
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
|
Sets the fallback BitmapFont.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="set_height">
|
<method name="set_height">
|
||||||
|
@ -136,24 +144,31 @@
|
||||||
<argument index="0" name="px" type="float">
|
<argument index="0" name="px" type="float">
|
||||||
</argument>
|
</argument>
|
||||||
<description>
|
<description>
|
||||||
Set the total font height (ascent plus descent) in pixels.
|
Sets the total font height (ascent plus descent) in pixels.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
</methods>
|
</methods>
|
||||||
<members>
|
<members>
|
||||||
<member name="ascent" type="float" setter="set_ascent" getter="get_ascent">
|
<member name="ascent" type="float" setter="set_ascent" getter="get_ascent">
|
||||||
|
Ascent (number of pixels above the baseline).
|
||||||
</member>
|
</member>
|
||||||
<member name="chars" type="PoolIntArray" setter="_set_chars" getter="_get_chars">
|
<member name="chars" type="PoolIntArray" setter="_set_chars" getter="_get_chars">
|
||||||
|
The characters in the BitmapFont.
|
||||||
</member>
|
</member>
|
||||||
<member name="distance_field" type="bool" setter="set_distance_field_hint" getter="is_distance_field_hint">
|
<member name="distance_field" type="bool" setter="set_distance_field_hint" getter="is_distance_field_hint">
|
||||||
|
If [code]true[/code] distance field hint is enabled.
|
||||||
</member>
|
</member>
|
||||||
<member name="fallback" type="BitmapFont" setter="set_fallback" getter="get_fallback">
|
<member name="fallback" type="BitmapFont" setter="set_fallback" getter="get_fallback">
|
||||||
|
The fallback font.
|
||||||
</member>
|
</member>
|
||||||
<member name="height" type="float" setter="set_height" getter="get_height">
|
<member name="height" type="float" setter="set_height" getter="get_height">
|
||||||
|
Total font height (ascent plus descent) in pixels.
|
||||||
</member>
|
</member>
|
||||||
<member name="kernings" type="PoolIntArray" setter="_set_kernings" getter="_get_kernings">
|
<member name="kernings" type="PoolIntArray" setter="_set_kernings" getter="_get_kernings">
|
||||||
|
The font's kernings as [PoolIntArray].
|
||||||
</member>
|
</member>
|
||||||
<member name="textures" type="Array" setter="_set_textures" getter="_get_textures">
|
<member name="textures" type="Array" setter="_set_textures" getter="_get_textures">
|
||||||
|
The font's [Texture]\ s.
|
||||||
</member>
|
</member>
|
||||||
</members>
|
</members>
|
||||||
<constants>
|
<constants>
|
||||||
|
|
Loading…
Reference in a new issue