Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

NinePatchRect

Inherits: Control < CanvasItem < Node < Object

A control that displays a texture by keeping its corners intact, but tiling its edges and center.

Description

Also 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×3 grid. When you scale the node, it tiles the texture's edges horizontally or vertically, tiles the center on both axes, and leaves the corners unchanged.

Properties

AxisStretchMode

axis_stretch_horizontal

0

AxisStretchMode

axis_stretch_vertical

0

bool

draw_center

true

MouseFilter

mouse_filter

2 (overrides Control)

int

patch_margin_bottom

0

int

patch_margin_left

0

int

patch_margin_right

0

int

patch_margin_top

0

Rect2

region_rect

Rect2(0, 0, 0, 0)

Texture2D

texture

Methods

int