SpinBox.xml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="SpinBox" inherits="Range" category="Core" version="3.1.2">
  3. <brief_description>
  4. Numerical input text field.
  5. </brief_description>
  6. <description>
  7. SpinBox is a numerical input text field. It allows entering integers and floats.
  8. [b]Example:[/b]
  9. [codeblock]
  10. var spin_box = SpinBox.new()
  11. add_child(spin_box)
  12. var line_edit = spin_box.get_line_edit()
  13. line_edit.context_menu_enabled = false
  14. spin_box.align = LineEdit.ALIGN_RIGHT
  15. [/codeblock]
  16. The above code will create a [SpinBox], disable context menu on it and set the text alignment to right.
  17. See [Range] class for more options over the [SpinBox].
  18. </description>
  19. <tutorials>
  20. </tutorials>
  21. <methods>
  22. <method name="get_line_edit">
  23. <return type="LineEdit">
  24. </return>
  25. <description>
  26. Returns the [LineEdit] instance from this [SpinBox]. You can use it to access properties and methods of [LineEdit].
  27. </description>
  28. </method>
  29. <method name="apply">
  30. <return type="void">
  31. </return>
  32. <description>
  33. Applies the current value of this [SpinBox].
  34. </description>
  35. </method>
  36. </methods>
  37. <members>
  38. <member name="align" type="int" setter="set_align" getter="get_align" enum="LineEdit.Align">
  39. Sets the text alignment of the [SpinBox].
  40. </member>
  41. <member name="editable" type="bool" setter="set_editable" getter="is_editable">
  42. If [code]true[/code], the [SpinBox] will be editable. Otherwise, it will be read only.
  43. </member>
  44. <member name="prefix" type="String" setter="set_prefix" getter="get_prefix">
  45. Adds the specified [code]prefix[/code] string before the numerical value of the [SpinBox].
  46. </member>
  47. <member name="suffix" type="String" setter="set_suffix" getter="get_suffix">
  48. Adds the specified [code]prefix[/code] string after the numerical value of the [SpinBox].
  49. </member>
  50. </members>
  51. <constants>
  52. </constants>
  53. <theme_items>
  54. <theme_item name="updown" type="Texture">
  55. Sets a custom [Texture] for up and down arrows of the [SpinBox].
  56. </theme_item>
  57. </theme_items>
  58. </class>