2017-09-12 20:42:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2022-03-16 22:01:02 +00:00
<class name= "BitmapFont" inherits= "Font" version= "3.5" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2017-09-12 20:42:36 +00:00
<brief_description >
2019-12-26 05:42:02 +00:00
Renders text using fonts under the [url=https://www.angelcode.com/products/bmfont/]BMFont[/url] format.
2020-01-23 10:14:14 +00:00
Handles files with the [code].fnt[/code] extension.
2017-09-12 20:42:36 +00:00
</brief_description>
<description >
2017-10-10 21:50:49 +00: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 20:42:36 +00:00
</description>
<tutorials >
</tutorials>
<methods >
<method name= "add_char" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "character" type= "int" />
<argument index= "1" name= "texture" type= "int" />
<argument index= "2" name= "rect" type= "Rect2" />
<argument index= "3" name= "align" type= "Vector2" default= "Vector2( 0, 0 )" />
<argument index= "4" name= "advance" type= "float" default= "-1" />
2017-09-12 20:42:36 +00:00
<description >
2019-06-21 23:04:47 +00: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 20:42:36 +00:00
</description>
</method>
<method name= "add_kerning_pair" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "char_a" type= "int" />
<argument index= "1" name= "char_b" type= "int" />
<argument index= "2" name= "kerning" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2019-03-29 22:37:35 +00: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 20:42:36 +00:00
</description>
</method>
<method name= "add_texture" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
<argument index= "0" name= "texture" type= "Texture" />
2017-09-12 20:42:36 +00:00
<description >
2019-03-29 22:37:35 +00:00
Adds a texture to the [BitmapFont].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "clear" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2017-09-12 20:42:36 +00:00
<description >
2017-10-10 21:50:49 +00:00
Clears all the font data and settings.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "create_from_fnt" >
2021-07-30 13:28:05 +00:00
<return type= "int" enum= "Error" />
<argument index= "0" name= "path" type= "String" />
2017-09-12 20:42:36 +00:00
<description >
2017-10-10 21:50:49 +00:00
Creates a BitmapFont from the [code]*.fnt[/code] file at [code]path[/code].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_kerning_pair" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
<argument index= "0" name= "char_a" type= "int" />
<argument index= "1" name= "char_b" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2017-10-10 21:50:49 +00:00
Returns a kerning pair as a difference.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_texture" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "Texture" />
<argument index= "0" name= "idx" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2017-10-10 21:50:49 +00:00
Returns the font atlas texture at index [code]idx[/code].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_texture_count" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2017-10-10 21:50:49 +00:00
Returns the number of textures in the BitmapFont atlas.
2017-09-12 20:42:36 +00:00
</description>
</method>
</methods>
<members >
2019-06-29 10:38:01 +00:00
<member name= "ascent" type= "float" setter= "set_ascent" getter= "get_ascent" default= "0.0" >
2017-10-10 21:50:49 +00:00
Ascent (number of pixels above the baseline).
2017-09-12 20:42:36 +00:00
</member>
2019-06-29 10:38:01 +00:00
<member name= "distance_field" type= "bool" setter= "set_distance_field_hint" getter= "is_distance_field_hint" default= "false" >
2018-12-20 12:46:54 +00:00
If [code]true[/code], distance field hint is enabled.
2017-09-12 20:42:36 +00:00
</member>
2019-07-15 18:42:47 +00:00
<member name= "fallback" type= "BitmapFont" setter= "set_fallback" getter= "get_fallback" >
2017-10-10 21:50:49 +00:00
The fallback font.
2017-09-12 20:42:36 +00:00
</member>
2019-06-29 10:38:01 +00:00
<member name= "height" type= "float" setter= "set_height" getter= "get_height" default= "1.0" >
2017-10-10 21:50:49 +00:00
Total font height (ascent plus descent) in pixels.
2017-09-12 20:42:36 +00:00
</member>
</members>
<constants >
</constants>
</class>