BitmapFont.xml 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="BitmapFont" inherits="Font" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  3. <brief_description>
  4. Renders text using fonts under the [url=https://www.angelcode.com/products/bmfont/]BMFont[/url] format.
  5. Handles files with the [code].fnt[/code] extension.
  6. </brief_description>
  7. <description>
  8. Renders text using [code]*.fnt[/code] fonts containing texture atlases. Supports distance fields. For using vector font files like TTF directly, see [DynamicFont].
  9. </description>
  10. <tutorials>
  11. </tutorials>
  12. <methods>
  13. <method name="add_char">
  14. <return type="void" />
  15. <argument index="0" name="character" type="int" />
  16. <argument index="1" name="texture" type="int" />
  17. <argument index="2" name="rect" type="Rect2" />
  18. <argument index="3" name="align" type="Vector2" default="Vector2( 0, 0 )" />
  19. <argument index="4" name="advance" type="float" default="-1" />
  20. <description>
  21. 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.
  22. </description>
  23. </method>
  24. <method name="add_kerning_pair">
  25. <return type="void" />
  26. <argument index="0" name="char_a" type="int" />
  27. <argument index="1" name="char_b" type="int" />
  28. <argument index="2" name="kerning" type="int" />
  29. <description>
  30. 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.
  31. </description>
  32. </method>
  33. <method name="add_texture">
  34. <return type="void" />
  35. <argument index="0" name="texture" type="Texture" />
  36. <description>
  37. Adds a texture to the [BitmapFont].
  38. </description>
  39. </method>
  40. <method name="clear">
  41. <return type="void" />
  42. <description>
  43. Clears all the font data and settings.
  44. </description>
  45. </method>
  46. <method name="create_from_fnt">
  47. <return type="int" enum="Error" />
  48. <argument index="0" name="path" type="String" />
  49. <description>
  50. Creates a BitmapFont from the [code]*.fnt[/code] file at [code]path[/code].
  51. </description>
  52. </method>
  53. <method name="get_kerning_pair" qualifiers="const">
  54. <return type="int" />
  55. <argument index="0" name="char_a" type="int" />
  56. <argument index="1" name="char_b" type="int" />
  57. <description>
  58. Returns a kerning pair as a difference.
  59. </description>
  60. </method>
  61. <method name="get_texture" qualifiers="const">
  62. <return type="Texture" />
  63. <argument index="0" name="idx" type="int" />
  64. <description>
  65. Returns the font atlas texture at index [code]idx[/code].
  66. </description>
  67. </method>
  68. <method name="get_texture_count" qualifiers="const">
  69. <return type="int" />
  70. <description>
  71. Returns the number of textures in the BitmapFont atlas.
  72. </description>
  73. </method>
  74. </methods>
  75. <members>
  76. <member name="ascent" type="float" setter="set_ascent" getter="get_ascent" default="0.0">
  77. Ascent (number of pixels above the baseline).
  78. </member>
  79. <member name="distance_field" type="bool" setter="set_distance_field_hint" getter="is_distance_field_hint" default="false">
  80. If [code]true[/code], distance field hint is enabled.
  81. </member>
  82. <member name="fallback" type="BitmapFont" setter="set_fallback" getter="get_fallback">
  83. The fallback font.
  84. </member>
  85. <member name="height" type="float" setter="set_height" getter="get_height" default="1.0">
  86. Total font height (ascent plus descent) in pixels.
  87. </member>
  88. </members>
  89. <constants>
  90. </constants>
  91. </class>