class_ninepatchrect.rst 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the NinePatchRect.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_NinePatchRect:
  5. NinePatchRect
  6. =============
  7. **Inherits:** :ref:`Control<class_control>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Scalable texture-based frame that tiles the texture's centers and sides, but keeps the corners' original size. Perfect for panels and dialog boxes.
  12. Member Functions
  13. ----------------
  14. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`int<class_int>` | :ref:`get_h_axis_stretch_mode<class_NinePatchRect_get_h_axis_stretch_mode>` **(** **)** const |
  16. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`int<class_int>` | :ref:`get_patch_margin<class_NinePatchRect_get_patch_margin>` **(** :ref:`int<class_int>` margin **)** const |
  18. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`Rect2<class_rect2>` | :ref:`get_region_rect<class_NinePatchRect_get_region_rect>` **(** **)** const |
  20. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`Texture<class_texture>` | :ref:`get_texture<class_NinePatchRect_get_texture>` **(** **)** const |
  22. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`int<class_int>` | :ref:`get_v_axis_stretch_mode<class_NinePatchRect_get_v_axis_stretch_mode>` **(** **)** const |
  24. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`bool<class_bool>` | :ref:`is_draw_center_enabled<class_NinePatchRect_is_draw_center_enabled>` **(** **)** const |
  26. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
  27. | void | :ref:`set_draw_center<class_NinePatchRect_set_draw_center>` **(** :ref:`bool<class_bool>` draw_center **)** |
  28. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`set_h_axis_stretch_mode<class_NinePatchRect_set_h_axis_stretch_mode>` **(** :ref:`int<class_int>` mode **)** |
  30. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`set_patch_margin<class_NinePatchRect_set_patch_margin>` **(** :ref:`int<class_int>` margin, :ref:`int<class_int>` value **)** |
  32. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`set_region_rect<class_NinePatchRect_set_region_rect>` **(** :ref:`Rect2<class_rect2>` rect **)** |
  34. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`set_texture<class_NinePatchRect_set_texture>` **(** :ref:`Texture<class_texture>` texture **)** |
  36. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`set_v_axis_stretch_mode<class_NinePatchRect_set_v_axis_stretch_mode>` **(** :ref:`int<class_int>` mode **)** |
  38. +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
  39. Signals
  40. -------
  41. - **texture_changed** **(** **)**
  42. Fired when the node's texture changes.
  43. Member Variables
  44. ----------------
  45. - :ref:`int<class_int>` **axis_stretch_horizontal** - Doesn't do anything at the time of writing.
  46. - :ref:`int<class_int>` **axis_stretch_vertical** - Doesn't do anything at the time of writing.
  47. - :ref:`bool<class_bool>` **draw_center** - If [code]true[/code], draw the panel's center. Else, only draw the 9-slice's borders. Default value: [code]true[/code]
  48. - :ref:`int<class_int>` **patch_margin_bottom** - The height of the 9-slice's bottom row. A margin of 16 means the 9-slice's bottom corners and side will have a height of 16 pixels. You can set all 4 margin values indivually to create panels with non-uniform borders.
  49. - :ref:`int<class_int>` **patch_margin_left** - The height of the 9-slice's left column.
  50. - :ref:`int<class_int>` **patch_margin_right** - The height of the 9-slice's right column.
  51. - :ref:`int<class_int>` **patch_margin_top** - The height of the 9-slice's top row.
  52. - :ref:`Rect2<class_rect2>` **region_rect** - Rectangular region of the texture to sample from. If you're working with an atlas, use this property to define the area the 9-slice should use. All other properties are relative to this one.
  53. - :ref:`Texture<class_texture>` **texture** - The node's texture resource.
  54. Numeric Constants
  55. -----------------
  56. - **AXIS_STRETCH_MODE_STRETCH** = **0** --- Doesn't do anything at the time of writing. Default value for ``axis_stretch_horizontal`` and ``axis_stretch_vertical``.
  57. - **AXIS_STRETCH_MODE_TILE** = **1** --- Doesn't do anything at the time of writing.
  58. - **AXIS_STRETCH_MODE_TILE_FIT** = **2** --- Doesn't do anything at the time of writing.
  59. Description
  60. -----------
  61. Better known as 9-slice panels, NinePatchRect produces clean panels of any size, based on a small texture. To do so, it splits the texture in a 3 by 3 grid. When you scale the node, it tiles the texture's sides horizontally or vertically, the center on both axes but it doesn't scale or tile the corners.
  62. Member Function Description
  63. ---------------------------
  64. .. _class_NinePatchRect_get_h_axis_stretch_mode:
  65. - :ref:`int<class_int>` **get_h_axis_stretch_mode** **(** **)** const
  66. .. _class_NinePatchRect_get_patch_margin:
  67. - :ref:`int<class_int>` **get_patch_margin** **(** :ref:`int<class_int>` margin **)** const
  68. .. _class_NinePatchRect_get_region_rect:
  69. - :ref:`Rect2<class_rect2>` **get_region_rect** **(** **)** const
  70. .. _class_NinePatchRect_get_texture:
  71. - :ref:`Texture<class_texture>` **get_texture** **(** **)** const
  72. .. _class_NinePatchRect_get_v_axis_stretch_mode:
  73. - :ref:`int<class_int>` **get_v_axis_stretch_mode** **(** **)** const
  74. .. _class_NinePatchRect_is_draw_center_enabled:
  75. - :ref:`bool<class_bool>` **is_draw_center_enabled** **(** **)** const
  76. .. _class_NinePatchRect_set_draw_center:
  77. - void **set_draw_center** **(** :ref:`bool<class_bool>` draw_center **)**
  78. .. _class_NinePatchRect_set_h_axis_stretch_mode:
  79. - void **set_h_axis_stretch_mode** **(** :ref:`int<class_int>` mode **)**
  80. .. _class_NinePatchRect_set_patch_margin:
  81. - void **set_patch_margin** **(** :ref:`int<class_int>` margin, :ref:`int<class_int>` value **)**
  82. .. _class_NinePatchRect_set_region_rect:
  83. - void **set_region_rect** **(** :ref:`Rect2<class_rect2>` rect **)**
  84. .. _class_NinePatchRect_set_texture:
  85. - void **set_texture** **(** :ref:`Texture<class_texture>` texture **)**
  86. .. _class_NinePatchRect_set_v_axis_stretch_mode:
  87. - void **set_v_axis_stretch_mode** **(** :ref:`int<class_int>` mode **)**