BitmapFont.xml 4.1 KB

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