Category: 2D Overlay
Syntax:
b2dDrawImage9Slice:Void(image:Int, x:Int, y:Int, width:Int, height:Int, left:Int, top:Int, right:Int, bottom:Int)
Void
Draws an image as a box of any size, keeping its corners at their own size (9-slice).
View detailed documentation online
; panel.png is 48 x 48 with a 16 pixel border
Global panel:Int = b2dLoadImage("Media/panel.png")
; a window, and a button below it, from the same image
b2dDrawImage9Slice(panel, 20, 20, 320, 200, 16, 16, 16, 16)
b2dDrawImage9Slice(panel, 20, 240, 120, 40, 16, 16, 16, 16)
BambooBasic © 2026 Michael Denathorn