Button.xml 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Button" inherits="BaseButton" version="3.2">
  3. <brief_description>
  4. Standard themed Button.
  5. </brief_description>
  6. <description>
  7. Button is the standard themed button. It can contain text and an icon, and will display them according to the current [Theme].
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. </methods>
  13. <members>
  14. <member name="align" type="int" setter="set_text_align" getter="get_text_align" enum="Button.TextAlign" default="1">
  15. Text alignment policy for the button's text, use one of the [enum TextAlign] constants.
  16. </member>
  17. <member name="clip_text" type="bool" setter="set_clip_text" getter="get_clip_text" default="false">
  18. When this property is enabled, text that is too large to fit the button is clipped, when disabled the Button will always be wide enough to hold the text.
  19. </member>
  20. <member name="expand_icon" type="bool" setter="set_expand_icon" getter="is_expand_icon" default="false">
  21. When enabled, the button's icon will expand/shrink to fit the button's size while keeping its aspect.
  22. </member>
  23. <member name="flat" type="bool" setter="set_flat" getter="is_flat" default="false">
  24. Flat buttons don't display decoration.
  25. </member>
  26. <member name="icon" type="Texture" setter="set_button_icon" getter="get_button_icon">
  27. Button's icon, if text is present the icon will be placed before the text.
  28. </member>
  29. <member name="text" type="String" setter="set_text" getter="get_text" default="&quot;&quot;">
  30. The button's text that will be displayed inside the button's area.
  31. </member>
  32. </members>
  33. <constants>
  34. <constant name="ALIGN_LEFT" value="0" enum="TextAlign">
  35. Align the text to the left.
  36. </constant>
  37. <constant name="ALIGN_CENTER" value="1" enum="TextAlign">
  38. Align the text to the center.
  39. </constant>
  40. <constant name="ALIGN_RIGHT" value="2" enum="TextAlign">
  41. Align the text to the right.
  42. </constant>
  43. </constants>
  44. <theme_items>
  45. <theme_item name="disabled" type="StyleBox">
  46. [StyleBox] used when the [Button] is disabled.
  47. </theme_item>
  48. <theme_item name="focus" type="StyleBox">
  49. [StyleBox] used when the [Button] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect.
  50. </theme_item>
  51. <theme_item name="font" type="Font">
  52. [Font] of the [Button]'s text.
  53. </theme_item>
  54. <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
  55. Default text [Color] of the [Button].
  56. </theme_item>
  57. <theme_item name="font_color_disabled" type="Color" default="Color( 0.9, 0.9, 0.9, 0.2 )">
  58. Text [Color] used when the [Button] is disabled.
  59. </theme_item>
  60. <theme_item name="font_color_hover" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
  61. Text [Color] used when the [Button] is being hovered.
  62. </theme_item>
  63. <theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
  64. Text [Color] used when the [Button] is being pressed.
  65. </theme_item>
  66. <theme_item name="hover" type="StyleBox">
  67. [StyleBox] used when the [Button] is being hovered.
  68. </theme_item>
  69. <theme_item name="hseparation" type="int" default="2">
  70. The horizontal space between [Button]'s icon and text.
  71. </theme_item>
  72. <theme_item name="normal" type="StyleBox">
  73. Default [StyleBox] for the [Button].
  74. </theme_item>
  75. <theme_item name="pressed" type="StyleBox">
  76. [StyleBox] used when the [Button] is being pressed.
  77. </theme_item>
  78. </theme_items>
  79. </class>