LineRenderBatcher

A context that allows to draw lines using AG (Accelerated Graphics).

You should use it by calling:

ctx.draw(matrix) { ctx.line(0, 0, 100, 100) ctx.line(100, 100, 0, 100) // ... }

Constructors

Link copied to clipboard
constructor(ctx: RenderContext)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var color: RGBA
Link copied to clipboard

Functions

Link copied to clipboard
inline fun <T> blending(blending: BlendMode, block: () -> T): T
Link copied to clipboard
inline fun color(color: RGBA, block: () -> Unit)
Link copied to clipboard
inline fun <T> draw(matrix: Matrix, body: () -> T): T

Prepares for drawing a set of lines with the specified matrix. It flushes all other contexts, and the set matrix.

Link copied to clipboard
inline fun drawVector(m: Matrix = currentMatrix, block: VectorBuilder.() -> Unit)
fun drawVector(path: VectorPath, m: Matrix = currentMatrix)
inline fun drawVector(color: RGBA, m: Matrix = currentMatrix, block: VectorBuilder.() -> Unit)
Link copied to clipboard
inline fun <T> drawWithGlobalMatrix(matrix: Matrix?, block: () -> T): T
Link copied to clipboard
fun flush()

Actually flushes all the pending lines. Shouldn't be called manually. You should call the draw method instead.

Link copied to clipboard
fun line(p0: Point, p1: Point, color0: RGBA = color, color1: RGBA = color0, m: Matrix = currentMatrix)
fun line(x0: Double, y0: Double, x1: Double, y1: Double, color0: RGBA = color, color1: RGBA = color0, m: Matrix = currentMatrix)
fun line(x0: Int, y0: Int, x1: Int, y1: Int, color0: RGBA = color, color1: RGBA = color0, m: Matrix = currentMatrix)

fun line(x0: Float, y0: Float, x1: Float, y1: Float, color0: RGBA = color, color1: RGBA = color0, m: Matrix = currentMatrix)

Draw a line from x0,y0 to x1,y1

Link copied to clipboard
inline fun use(block: (LineRenderBatcher) -> Unit)