Interface FlowCanvas
access this type via: ui.FlowCanvas (provides, requires or uses)
FlowCanvas is a direct rendering API for 2D graphics, generally used by applications such as video games. All of the functions in this API must only be called from the main thread of your program.
Functions
void pushSurface(
Rect rect, int xscr, int yscr, byte alpha)
void popSurface()
void line(
Line2D line,
optional int lineWidth)
void curve(
Curve2D line, int isteps,
optional int lineWidth)
void rectOutline(
Rect2D rect,
optional int lineWidth)
void roundedRect(
Rect2D rect, int xRadius, int yRadius)
void roundedRectOutline(
Rect2D rect, int xRadius, int yRadius,
optional int lineWidth)
void ellipseOutline(
Ellipse2D ellipse,
optional int lineWidth)
void arcOutline(
Arc2D ellipse,
optional int lineWidth)
void pixels(
PixelMap map, int x, int y,
optional int scaledWidth, int scaledHeight, int rotation, Point rPoint, Rect clipFrame)
void pixelsYUV(
PixelMapYUV map, int x, int y,
optional int scaledWidth, int scaledHeight, int rotation, Point rPoint, Rect clipFrame)
void texture(
FlowTexture tex, int x, int y,
optional int scaledWidth, int scaledHeight, int rotation, Point rPoint, Rect clipFrame)
Initialise a new direct rendering canvas, specifying the target renderer.
void pushSurface(
Rect rect, int xscr, int yscr, byte alpha)
Push a new surface to the surface stack, using the given rect instance to indicate the x/y position and width/height. Any new draw operations will take place inside this surface, with the zero x/y coordinates of draw commands being relative to the top left corner of the surface, and will be clipped at the surface's width/height.
rect The x/y coordinate and width/height of the surface.
xscr The amount, in pixels, by which the surface is 'scrolled' on the X-axis.
yscr The amount, in pixels, by which the surface is 'scrolled' on the Y-axis.
alpha The alpha blend to apply to elements drawn on the surface.
void popSurface()
Pop the top-most surface from the surface stack.
Draw a single-pixel point at the given location and with the given color.
void line(
Line2D line,
optional int lineWidth)
Draw a line between two points, the given description of size, position, and color.
void curve(
Curve2D line, int isteps,
optional int lineWidth)
Draw a line between two points, the given description of size, position, and color.
Draw a filled rectangle using the given description of size, position, and color.
void rectOutline(
Rect2D rect,
optional int lineWidth)
Draw an outline rectangle using the given description of size, position, and color.
void roundedRect(
Rect2D rect, int xRadius, int yRadius)
Draw a filled rectangle with rounded corners using the given description of size, position, and color.
void roundedRectOutline(
Rect2D rect, int xRadius, int yRadius,
optional int lineWidth)
Draw an outline rectangle with rounded corners using the given description of size, position, and color.
Draw a filled ellipse using the given description of position, radius, and color.
void ellipseOutline(
Ellipse2D ellipse,
optional int lineWidth)
Draw an outline ellipse using the given description of position, radius, and color.
Draw a filled arc using the given description of position, radius, and color.
void arcOutline(
Arc2D ellipse,
optional int lineWidth)
Draw an outline arc using the given description of position, radius, and color.
Draw a filled pie using the given description of position, radius, and color.
Draw a filled polygon bounded by curves.
void pixels(
PixelMap map, int x, int y,
optional int scaledWidth, int scaledHeight, int rotation, Point rPoint, Rect clipFrame)
Draw a rectangle of pixels, at the given position, with the given rotation in degrees.
map The pixels to draw.
x The X position at which to draw the top-left of the pixel map.
y The Y position at which to draw the top-left of the pixel map.
scaledWidth The width in pixels at which to scale the image.
scaledHeight The height in pixels at which to scale the image.
rotation The rotation to apply to the pixel map, in degrees.
clipFrame The clipping boundary.
void pixelsYUV(
PixelMapYUV map, int x, int y,
optional int scaledWidth, int scaledHeight, int rotation, Point rPoint, Rect clipFrame)
Draw a rectangle of pixels in YUV format, at the given position, with the given rotation in degrees.
map The pixels to draw.
x The X position at which to draw the top-left of the pixel map.
y The Y position at which to draw the top-left of the pixel map.
scaledWidth The width in pixels at which to scale the image.
scaledHeight The height in pixels at which to scale the image.
rotation The rotation to apply to the pixel map, in degrees.
clipFrame The clipping boundary.
Draw a piece of text, at the given position, with the given font.
position The x/y coordinate at which to draw the top left of the text.
f The font with which to draw the text.
text The text to draw.
rotation The rotation to apply to the text, in degrees.
void texture(
FlowTexture tex, int x, int y,
optional int scaledWidth, int scaledHeight, int rotation, Point rPoint, Rect clipFrame)
Draw a texture at the given position.
tex The texture to draw.
x The X position at which to draw the top-left of the pixel map.
y The Y position at which to draw the top-left of the pixel map.
scaledWidth The width in pixels at which to scale the image.
scaledHeight The height in pixels at which to scale the image.
rotation The rotation to apply to the pixel map, in degrees.
clipFrame The clipping boundary.