b2dDrawImage9Slice

Draws an image as a box of any size, keeping its corners at their own size (9-slice).

2D Overlay

Parameters & Returns

Parameters

image Int
x Int
y Int
width Int
height Int
left Int
top Int
right Int
bottom Int

Returns

Void

Quick Summary

Draws an image as a box of any size, keeping its corners at their own size (9-slice).

Technical Exegesis...

Draws the image stretched to a width x height box with its top-left at x,y, the way panels, buttons and windows are usually drawn. left, top, right and bottom are the widths of the image's border, in pixels of the image. They split it into nine pieces: the four corners are drawn at their own size, the top and bottom edges stretch across, the left and right edges stretch down, and the middle stretches both ways.

Example

Example.bam
; 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)