BoxContainer.xml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="BoxContainer" inherits="Container" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  3. <brief_description>
  4. A container that arranges its child controls horizontally or vertically.
  5. </brief_description>
  6. <description>
  7. A container that arranges its child controls horizontally or vertically, rearranging them automatically when their minimum size changes.
  8. </description>
  9. <tutorials>
  10. <link title="Using Containers">$DOCS_URL/tutorials/ui/gui_containers.html</link>
  11. </tutorials>
  12. <methods>
  13. <method name="add_spacer">
  14. <return type="Control" />
  15. <param index="0" name="begin" type="bool" />
  16. <description>
  17. Adds a [Control] node to the box as a spacer. If [param begin] is [code]true[/code], it will insert the [Control] node in front of all other children.
  18. </description>
  19. </method>
  20. </methods>
  21. <members>
  22. <member name="alignment" type="int" setter="set_alignment" getter="get_alignment" enum="BoxContainer.AlignmentMode" default="0">
  23. The alignment of the container's children (must be one of [constant ALIGNMENT_BEGIN], [constant ALIGNMENT_CENTER], or [constant ALIGNMENT_END]).
  24. </member>
  25. <member name="vertical" type="bool" setter="set_vertical" getter="is_vertical" default="false">
  26. If [code]true[/code], the [BoxContainer] will arrange its children vertically, rather than horizontally.
  27. Can't be changed when using [HBoxContainer] and [VBoxContainer].
  28. </member>
  29. </members>
  30. <constants>
  31. <constant name="ALIGNMENT_BEGIN" value="0" enum="AlignmentMode">
  32. The child controls will be arranged at the beginning of the container, i.e. top if orientation is vertical, left if orientation is horizontal (right for RTL layout).
  33. </constant>
  34. <constant name="ALIGNMENT_CENTER" value="1" enum="AlignmentMode">
  35. The child controls will be centered in the container.
  36. </constant>
  37. <constant name="ALIGNMENT_END" value="2" enum="AlignmentMode">
  38. The child controls will be arranged at the end of the container, i.e. bottom if orientation is vertical, right if orientation is horizontal (left for RTL layout).
  39. </constant>
  40. </constants>
  41. <theme_items>
  42. <theme_item name="separation" data_type="constant" type="int" default="4">
  43. The space between the [BoxContainer]'s elements, in pixels.
  44. </theme_item>
  45. </theme_items>
  46. </class>