BitmapFont.xml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="BitmapFont" inherits="Font" version="3.3">
  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. </return>
  16. <argument index="0" name="character" type="int">
  17. </argument>
  18. <argument index="1" name="texture" type="int">
  19. </argument>
  20. <argument index="2" name="rect" type="Rect2">
  21. </argument>
  22. <argument index="3" name="align" type="Vector2" default="Vector2( 0, 0 )">
  23. </argument>
  24. <argument index="4" name="advance" type="float" default="-1">
  25. </argument>
  26. <description>
  27. 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.
  28. </description>
  29. </method>
  30. <method name="add_kerning_pair">
  31. <return type="void">
  32. </return>
  33. <argument index="0" name="char_a" type="int">
  34. </argument>
  35. <argument index="1" name="char_b" type="int">
  36. </argument>
  37. <argument index="2" name="kerning" type="int">
  38. </argument>
  39. <description>
  40. 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.
  41. </description>
  42. </method>
  43. <method name="add_texture">
  44. <return type="void">
  45. </return>
  46. <argument index="0" name="texture" type="Texture">
  47. </argument>
  48. <description>
  49. Adds a texture to the [BitmapFont].
  50. </description>
  51. </method>
  52. <method name="clear">
  53. <return type="void">
  54. </return>
  55. <description>
  56. Clears all the font data and settings.
  57. </description>
  58. </method>
  59. <method name="create_from_fnt">
  60. <return type="int" enum="Error">
  61. </return>
  62. <argument index="0" name="path" type="String">
  63. </argument>
  64. <description>
  65. Creates a BitmapFont from the [code]*.fnt[/code] file at [code]path[/code].
  66. </description>
  67. </method>
  68. <method name="get_kerning_pair" qualifiers="const">
  69. <return type="int">
  70. </return>
  71. <argument index="0" name="char_a" type="int">
  72. </argument>
  73. <argument index="1" name="char_b" type="int">
  74. </argument>
  75. <description>
  76. Returns a kerning pair as a difference.
  77. </description>
  78. </method>
  79. <method name="get_texture" qualifiers="const">
  80. <return type="Texture">
  81. </return>
  82. <argument index="0" name="idx" type="int">
  83. </argument>
  84. <description>
  85. Returns the font atlas texture at index [code]idx[/code].
  86. </description>
  87. </method>
  88. <method name="get_texture_count" qualifiers="const">
  89. <return type="int">
  90. </return>
  91. <description>
  92. Returns the number of textures in the BitmapFont atlas.
  93. </description>
  94. </method>
  95. </methods>
  96. <members>
  97. <member name="ascent" type="float" setter="set_ascent" getter="get_ascent" default="0.0">
  98. Ascent (number of pixels above the baseline).
  99. </member>
  100. <member name="distance_field" type="bool" setter="set_distance_field_hint" getter="is_distance_field_hint" default="false">
  101. If [code]true[/code], distance field hint is enabled.
  102. </member>
  103. <member name="fallback" type="BitmapFont" setter="set_fallback" getter="get_fallback">
  104. The fallback font.
  105. </member>
  106. <member name="height" type="float" setter="set_height" getter="get_height" default="1.0">
  107. Total font height (ascent plus descent) in pixels.
  108. </member>
  109. </members>
  110. <constants>
  111. </constants>
  112. </class>