BitmapFont.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="BitmapFont" inherits="Font" category="Core" version="3.1.2">
  3. <brief_description>
  4. Renders text using [code]*.fnt[/code] fonts.
  5. </brief_description>
  6. <description>
  7. Renders text using [code]*.fnt[/code] fonts containing texture atlases. Supports distance fields. For using vector font files like TTF directly, see [DynamicFont].
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="add_char">
  13. <return type="void">
  14. </return>
  15. <argument index="0" name="character" type="int">
  16. </argument>
  17. <argument index="1" name="texture" type="int">
  18. </argument>
  19. <argument index="2" name="rect" type="Rect2">
  20. </argument>
  21. <argument index="3" name="align" type="Vector2" default="Vector2( 0, 0 )">
  22. </argument>
  23. <argument index="4" name="advance" type="float" default="-1">
  24. </argument>
  25. <description>
  26. 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.
  27. </description>
  28. </method>
  29. <method name="add_kerning_pair">
  30. <return type="void">
  31. </return>
  32. <argument index="0" name="char_a" type="int">
  33. </argument>
  34. <argument index="1" name="char_b" type="int">
  35. </argument>
  36. <argument index="2" name="kerning" type="int">
  37. </argument>
  38. <description>
  39. Adds a kerning pair to the [code]BitmapFont[/code] as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character.
  40. </description>
  41. </method>
  42. <method name="add_texture">
  43. <return type="void">
  44. </return>
  45. <argument index="0" name="texture" type="Texture">
  46. </argument>
  47. <description>
  48. Adds a texture to the [code]BitmapFont[/code].
  49. </description>
  50. </method>
  51. <method name="clear">
  52. <return type="void">
  53. </return>
  54. <description>
  55. Clears all the font data and settings.
  56. </description>
  57. </method>
  58. <method name="create_from_fnt">
  59. <return type="int" enum="Error">
  60. </return>
  61. <argument index="0" name="path" type="String">
  62. </argument>
  63. <description>
  64. Creates a BitmapFont from the [code]*.fnt[/code] file at [code]path[/code].
  65. </description>
  66. </method>
  67. <method name="get_char_size" qualifiers="const">
  68. <return type="Vector2">
  69. </return>
  70. <argument index="0" name="char" type="int">
  71. </argument>
  72. <argument index="1" name="next" type="int" default="0">
  73. </argument>
  74. <description>
  75. Returns the size of a character, optionally taking kerning into account if the next character is provided.
  76. </description>
  77. </method>
  78. <method name="get_kerning_pair" qualifiers="const">
  79. <return type="int">
  80. </return>
  81. <argument index="0" name="char_a" type="int">
  82. </argument>
  83. <argument index="1" name="char_b" type="int">
  84. </argument>
  85. <description>
  86. Returns a kerning pair as a difference.
  87. </description>
  88. </method>
  89. <method name="get_texture" qualifiers="const">
  90. <return type="Texture">
  91. </return>
  92. <argument index="0" name="idx" type="int">
  93. </argument>
  94. <description>
  95. Returns the font atlas texture at index [code]idx[/code].
  96. </description>
  97. </method>
  98. <method name="get_texture_count" qualifiers="const">
  99. <return type="int">
  100. </return>
  101. <description>
  102. Returns the number of textures in the BitmapFont atlas.
  103. </description>
  104. </method>
  105. </methods>
  106. <members>
  107. <member name="ascent" type="float" setter="set_ascent" getter="get_ascent">
  108. Ascent (number of pixels above the baseline).
  109. </member>
  110. <member name="distance_field" type="bool" setter="set_distance_field_hint" getter="is_distance_field_hint">
  111. If [code]true[/code], distance field hint is enabled.
  112. </member>
  113. <member name="fallback" type="BitmapFont" setter="set_fallback" getter="get_fallback">
  114. The fallback font.
  115. </member>
  116. <member name="height" type="float" setter="set_height" getter="get_height">
  117. Total font height (ascent plus descent) in pixels.
  118. </member>
  119. </members>
  120. <constants>
  121. </constants>
  122. </class>