.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the NinePatchRect.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_NinePatchRect: NinePatchRect ============= **Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` **Category:** Core Brief Description ----------------- Scalable texture-based frame that tiles the texture's centers and sides, but keeps the corners' original size. Perfect for panels and dialog boxes. Member Functions ---------------- +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_h_axis_stretch_mode` **(** **)** const | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_patch_margin` **(** :ref:`int` margin **)** const | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Rect2` | :ref:`get_region_rect` **(** **)** const | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Texture` | :ref:`get_texture` **(** **)** const | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_v_axis_stretch_mode` **(** **)** const | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_draw_center_enabled` **(** **)** const | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_draw_center` **(** :ref:`bool` draw_center **)** | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_h_axis_stretch_mode` **(** :ref:`int` mode **)** | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_patch_margin` **(** :ref:`int` margin, :ref:`int` value **)** | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_region_rect` **(** :ref:`Rect2` rect **)** | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_texture` **(** :ref:`Texture` texture **)** | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_v_axis_stretch_mode` **(** :ref:`int` mode **)** | +--------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ Signals ------- - **texture_changed** **(** **)** Fired when the node's texture changes. Member Variables ---------------- - :ref:`int` **axis_stretch_horizontal** - Doesn't do anything at the time of writing. - :ref:`int` **axis_stretch_vertical** - Doesn't do anything at the time of writing. - :ref:`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] - :ref:`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. - :ref:`int` **patch_margin_left** - The height of the 9-slice's left column. - :ref:`int` **patch_margin_right** - The height of the 9-slice's right column. - :ref:`int` **patch_margin_top** - The height of the 9-slice's top row. - :ref:`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. - :ref:`Texture` **texture** - The node's texture resource. Numeric Constants ----------------- - **AXIS_STRETCH_MODE_STRETCH** = **0** --- Doesn't do anything at the time of writing. Default value for ``axis_stretch_horizontal`` and ``axis_stretch_vertical``. - **AXIS_STRETCH_MODE_TILE** = **1** --- Doesn't do anything at the time of writing. - **AXIS_STRETCH_MODE_TILE_FIT** = **2** --- Doesn't do anything at the time of writing. Description ----------- 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. Member Function Description --------------------------- .. _class_NinePatchRect_get_h_axis_stretch_mode: - :ref:`int` **get_h_axis_stretch_mode** **(** **)** const .. _class_NinePatchRect_get_patch_margin: - :ref:`int` **get_patch_margin** **(** :ref:`int` margin **)** const .. _class_NinePatchRect_get_region_rect: - :ref:`Rect2` **get_region_rect** **(** **)** const .. _class_NinePatchRect_get_texture: - :ref:`Texture` **get_texture** **(** **)** const .. _class_NinePatchRect_get_v_axis_stretch_mode: - :ref:`int` **get_v_axis_stretch_mode** **(** **)** const .. _class_NinePatchRect_is_draw_center_enabled: - :ref:`bool` **is_draw_center_enabled** **(** **)** const .. _class_NinePatchRect_set_draw_center: - void **set_draw_center** **(** :ref:`bool` draw_center **)** .. _class_NinePatchRect_set_h_axis_stretch_mode: - void **set_h_axis_stretch_mode** **(** :ref:`int` mode **)** .. _class_NinePatchRect_set_patch_margin: - void **set_patch_margin** **(** :ref:`int` margin, :ref:`int` value **)** .. _class_NinePatchRect_set_region_rect: - void **set_region_rect** **(** :ref:`Rect2` rect **)** .. _class_NinePatchRect_set_texture: - void **set_texture** **(** :ref:`Texture` texture **)** .. _class_NinePatchRect_set_v_axis_stretch_mode: - void **set_v_axis_stretch_mode** **(** :ref:`int` mode **)**