new NinePatch(image)
A stretchable image that has borders.
Similar to the Android NinePatch, but it only has the lines on the bottom and right edges to denote the stretchable area.
A NinePatch is a normal picture, but has an extra 1-pixel wide column on the right edge and bottom edge. The extra column contains a black line that denotes the tileable center portion of the image. The lines are used to divide the image into nine tiles that can be automatically repeated to stretch the picture to any size without distortion.
Parameters:
Name | Type | Description |
---|---|---|
image |
external:image | The source image to make stretchable. |
- Source:
Methods
draw(context, x, y, width, height)
Draw the image stretched to a given rectangle.
Parameters:
Name | Type | Description |
---|---|---|
context |
external:CanvasRenderingContext2D | The drawing context. |
x |
number | The left side of the rectangle. |
y |
number | The top of the rectangle. |
width |
number | The width of the rectangle. |
height |
number | The height of the rectangle. |
- Source: