2017-09-12 22:42:36 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
<class name= "BitmapFont" inherits= "Font" category= "Core" version= "3.0.alpha.custom_build" >
<brief_description >
2017-10-10 23:50:49 +02:00
Renders text using [code]*.fnt[/code] fonts.
2017-09-12 22:42:36 +02:00
</brief_description>
<description >
2017-10-10 23:50:49 +02:00
Renders text using [code]*.fnt[/code] fonts containing texture atlases. Supports distance fields. For using vector font files like TTF directly, see [DynamicFont].
2017-09-12 22:42:36 +02:00
</description>
<tutorials >
</tutorials>
<demos >
</demos>
<methods >
<method name= "add_char" >
<return type= "void" >
</return>
<argument index= "0" name= "character" type= "int" >
</argument>
<argument index= "1" name= "texture" type= "int" >
</argument>
<argument index= "2" name= "rect" type= "Rect2" >
</argument>
<argument index= "3" name= "align" type= "Vector2" default= "Vector2( 0, 0 )" >
</argument>
<argument index= "4" name= "advance" type= "float" default= "-1" >
</argument>
<description >
2017-10-10 23:50:49 +02:00
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.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "add_kerning_pair" >
<return type= "void" >
</return>
<argument index= "0" name= "char_a" type= "int" >
</argument>
<argument index= "1" name= "char_b" type= "int" >
</argument>
<argument index= "2" name= "kerning" type= "int" >
</argument>
<description >
2017-10-10 23:50:49 +02:00
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.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "add_texture" >
<return type= "void" >
</return>
<argument index= "0" name= "texture" type= "Texture" >
</argument>
<description >
2017-10-10 23:50:49 +02:00
Adds a texture to the [BitmapFont].
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "clear" >
<return type= "void" >
</return>
<description >
2017-10-10 23:50:49 +02:00
Clears all the font data and settings.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "create_from_fnt" >
<return type= "int" enum= "Error" >
</return>
<argument index= "0" name= "path" type= "String" >
</argument>
<description >
2017-10-10 23:50:49 +02:00
Creates a BitmapFont from the [code]*.fnt[/code] file at [code]path[/code].
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_char_size" qualifiers= "const" >
<return type= "Vector2" >
</return>
<argument index= "0" name= "char" type= "int" >
</argument>
<argument index= "1" name= "next" type= "int" default= "0" >
</argument>
<description >
2017-10-10 23:50:49 +02:00
Returns the size of a character, optionally taking kerning into account if the next character is provided.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_fallback" qualifiers= "const" >
<return type= "BitmapFont" >
</return>
<description >
2017-10-10 23:50:49 +02:00
Returns the fallback BitmapFont.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_kerning_pair" qualifiers= "const" >
<return type= "int" >
</return>
<argument index= "0" name= "char_a" type= "int" >
</argument>
<argument index= "1" name= "char_b" type= "int" >
</argument>
<description >
2017-10-10 23:50:49 +02:00
Returns a kerning pair as a difference.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_texture" qualifiers= "const" >
<return type= "Texture" >
</return>
<argument index= "0" name= "idx" type= "int" >
</argument>
<description >
2017-10-10 23:50:49 +02:00
Returns the font atlas texture at index [code]idx[/code].
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_texture_count" qualifiers= "const" >
<return type= "int" >
</return>
<description >
2017-10-10 23:50:49 +02:00
Returns the number of textures in the BitmapFont atlas.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "set_ascent" >
<return type= "void" >
</return>
<argument index= "0" name= "px" type= "float" >
</argument>
<description >
2017-10-10 23:50:49 +02:00
Sets the font ascent (number of pixels above the baseline).
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "set_distance_field_hint" >
<return type= "void" >
</return>
<argument index= "0" name= "enable" type= "bool" >
</argument>
<description >
2017-10-10 23:50:49 +02:00
If [code]true[/code] distance field hint is enabled.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "set_fallback" >
<return type= "void" >
</return>
<argument index= "0" name= "fallback" type= "BitmapFont" >
</argument>
<description >
2017-10-10 23:50:49 +02:00
Sets the fallback BitmapFont.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "set_height" >
<return type= "void" >
</return>
<argument index= "0" name= "px" type= "float" >
</argument>
<description >
2017-10-10 23:50:49 +02:00
Sets the total font height (ascent plus descent) in pixels.
2017-09-12 22:42:36 +02:00
</description>
</method>
</methods>
<members >
2017-09-13 08:49:40 +02:00
<member name= "ascent" type= "float" setter= "set_ascent" getter= "get_ascent" >
2017-10-10 23:50:49 +02:00
Ascent (number of pixels above the baseline).
2017-09-12 22:42:36 +02:00
</member>
2017-09-13 08:49:40 +02:00
<member name= "chars" type= "PoolIntArray" setter= "_set_chars" getter= "_get_chars" >
2017-10-10 23:50:49 +02:00
The characters in the BitmapFont.
2017-09-12 22:42:36 +02:00
</member>
2017-09-13 08:49:40 +02:00
<member name= "distance_field" type= "bool" setter= "set_distance_field_hint" getter= "is_distance_field_hint" >
2017-10-10 23:50:49 +02:00
If [code]true[/code] distance field hint is enabled.
2017-09-12 22:42:36 +02:00
</member>
2017-09-13 08:49:40 +02:00
<member name= "fallback" type= "BitmapFont" setter= "set_fallback" getter= "get_fallback" >
2017-10-10 23:50:49 +02:00
The fallback font.
2017-09-12 22:42:36 +02:00
</member>
2017-09-13 08:49:40 +02:00
<member name= "height" type= "float" setter= "set_height" getter= "get_height" >
2017-10-10 23:50:49 +02:00
Total font height (ascent plus descent) in pixels.
2017-09-12 22:42:36 +02:00
</member>
2017-09-13 08:49:40 +02:00
<member name= "kernings" type= "PoolIntArray" setter= "_set_kernings" getter= "_get_kernings" >
2017-10-10 23:50:49 +02:00
The font's kernings as [PoolIntArray].
2017-09-12 22:42:36 +02:00
</member>
2017-09-13 08:49:40 +02:00
<member name= "textures" type= "Array" setter= "_set_textures" getter= "_get_textures" >
2017-10-10 23:50:49 +02:00
The font's [Texture]\ s.
2017-09-12 22:42:36 +02:00
</member>
</members>
<constants >
</constants>
</class>