PointClickEngine::Graphics::UI::NinePatch
Inherits Reference < Object
Nine-patch sprite for scalable UI elements
A nine-patch divides an image into 9 sections:
+---+-------+---+
| 1 | 2 | 3 |
+---+-------+---+
| 4 | 5 | 6 |
+---+-------+---+
| 7 | 8 | 9 |
+---+-------+---+
Corners (1,3,7,9) are drawn at original size Edges (2,4,6,8) are stretched in one dimension Center (5) is stretched in both dimensions
Constructors
new(texture_path : String | Nil = nil)
Sourcenew(texture : RL::Texture2D, left : Int32 = 8, right : Int32 = 8, top : Int32 = 8, bottom : Int32 = 8)
SourceInstance methods
border_bottom
Sourceborder_bottom=(border_bottom : Int32)
Sourceborder_right
Sourceborder_right=(border_right : Int32)
Sourceborder_top
Sourceborder_top=(border_top : Int32)
Sourcecreate_scaled_texture(width : Int32, height : Int32) : RL::RenderTexture2D | Nil
Create a render target with nine-patch at specific size (for caching)
draw(x : Float32, y : Float32, width : Float32, height : Float32)
Draw the nine-patch at specified position and size
draw_centered(center_x : Float32, center_y : Float32, width : Float32, height : Float32)
Draw centered at position
draw_with_context(context : PointClickEngine::Graphics::RenderContext, x : Float32, y : Float32, width : Float32, height : Float32)
Draw with render context
min_height
Sourcetexture_path
Source