# NinePatch 9-slice sprite scaling via Draw2D.draw_texture_region(). ```{raw} html ▶ Run in browser ``` **Tags:** `2d` Generates a test panel texture with distinct corners, edges, and centre, then renders NinePatchRect nodes at various sizes to demonstrate that: - Corners maintain their original pixel size - Edges stretch in one direction only - Centre fills the remaining space Shows the engine's in-memory texture API: the ``texture`` property on NinePatchRect accepts an RGBA uint8 ``numpy.ndarray`` directly, no file I/O required. ## Source ```{literalinclude} ../../examples/features/2d/ninepatch.py :language: python :linenos: ```