Context2d

open class Context2d(val renderer: Renderer, val defaultFontRegistry: FontRegistry? = null, val defaultFont: Font? = null) : VectorBuilder, Disposable

Inheritors

Constructors

Link copied to clipboard
constructor(renderer: Renderer, defaultFontRegistry: FontRegistry? = null, defaultFont: Font? = null)

Types

Link copied to clipboard
class ScaledRenderer(val parent: Renderer, val scaleX: Float, val scaleY: Float) : Renderer
Link copied to clipboard
data class State(var transform: Matrix = Matrix.IDENTITY, var clip: VectorPath? = null, var path: VectorPath = VectorPath(), var lineScaleMode: LineScaleMode = LineScaleMode.NORMAL, var lineWidth: Double = 1.0, var startLineCap: LineCap = LineCap.BUTT, var endLineCap: LineCap = LineCap.BUTT, var lineJoin: LineJoin = LineJoin.MITER, var miterLimit: Double = 10.0, var strokeStyle: Paint = DefaultPaint, var fillStyle: Paint = DefaultPaint, var fontRegistry: FontRegistry? = null, var font: Font? = null, var fontSize: Double = 24.0, var verticalAlign: VerticalAlign = VerticalAlign.BASELINE, var horizontalAlign: HorizontalAlign = HorizontalAlign.LEFT, var globalAlpha: Double = 1.0, var globalCompositeOperation: CompositeOperation = CompositeMode.SOURCE_OVER, var lineDash: DoubleList? = null, var lineDashOffset: Double = 0.0)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val defaultFont: Font? = null
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var font: Font?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open val height: Int
Link copied to clipboard
Link copied to clipboard
open override var lastMovePos: Point
Link copied to clipboard
open override var lastPos: Point
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val totalPoints: Int
Link copied to clipboard
Link copied to clipboard
open val width: Int

Functions

Link copied to clipboard
open fun arc(center: Point, r: Double, start: Angle, end: Angle, counterclockwise: Boolean)
Link copied to clipboard
open fun arcTo(a: Point, c: Point, r: Double)
open fun arcTo(a: Point, c: Point, r: Float)
Link copied to clipboard
fun Context2d.arrow(p0: Point, p1: Point, width: Double, paint: Paint, capEnd: ArrowCap = ArrowCap.Line(null), capStart: ArrowCap = ArrowCap.NoCap)
Link copied to clipboard
fun Context2d.arrowCap(p0: Point, p1: Point, width: Double, paint: Paint, cap: ArrowCap)
Link copied to clipboard
fun Context2d.arrowTo(p1: Point, width: Double, paint: Paint, capEnd: ArrowCap = ArrowCap.Line(null), capStart: ArrowCap = ArrowCap.NoCap)
Link copied to clipboard
fun beginPath()
Link copied to clipboard
inline fun <T> buffering(callback: () -> T): T
Link copied to clipboard
fun VectorBuilder.cfCubicTo(fcx1: Double, fcy1: Double, fcx2: Double, fcy2: Double, fax: Double, fay: Double)
Link copied to clipboard
Link copied to clipboard
fun VectorBuilder.cfrCubicTo(cx1: Double, cy1: Double, cx2: Double, cy2: Double, ax: Double, ay: Double)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun circle(circle: Circle)
open fun circle(center: Point, radius: Double)
Link copied to clipboard
open fun circleHole(circle: Circle)
open fun circleHole(center: Point, radius: Double)
Link copied to clipboard
fun clip(path: VectorPath? = state.path, winding: Winding = Winding.NON_ZERO)
fun clip(buildClipShape: () -> Unit, useClipShape: () -> Unit)
inline fun clip(path: VectorPath?, winding: Winding = Winding.NON_ZERO, block: () -> Unit)
inline fun clip(path: VectorPath.() -> Unit, winding: Winding = Winding.NON_ZERO, block: () -> Unit)
Link copied to clipboard
open override fun close()
Link copied to clipboard
fun createColor(color: RGBA): RGBA
Link copied to clipboard
inline fun createLinearGradient(x0: Number, y0: Number, x1: Number, y1: Number, cycle: CycleMethod = CycleMethod.NO_CYCLE, transform: Matrix = Matrix.IDENTITY, block: GradientPaint.() -> Unit = {}): GradientPaint
Link copied to clipboard
fun createPattern(bitmap: Bitmap, repeat: Boolean = false, smooth: Boolean = true, transform: Matrix = Matrix.IDENTITY): BitmapPaint
fun createPattern(bitmap: Bitmap, cycleX: CycleMethod = CycleMethod.NO_CYCLE, cycleY: CycleMethod = cycleX, smooth: Boolean = true, transform: Matrix = Matrix.IDENTITY): BitmapPaint
Link copied to clipboard
inline fun createRadialGradient(x0: Number, y0: Number, r0: Number, x1: Number, y1: Number, r1: Number, cycle: CycleMethod = CycleMethod.NO_CYCLE, transform: Matrix = Matrix.IDENTITY, block: GradientPaint.() -> Unit = {}): GradientPaint
Link copied to clipboard
inline fun createSweepGradient(x0: Number, y0: Number, startAngle: Angle = Angle.ZERO, transform: Matrix = Matrix.IDENTITY, block: GradientPaint.() -> Unit = {}): GradientPaint
Link copied to clipboard
open fun cubic(o: Point, c1: Point, c2: Point, a: Point)
Link copied to clipboard
open override fun cubicTo(c1: Point, c2: Point, a: Point)
open fun cubicTo(c1x: Double, c1y: Double, c2x: Double, c2y: Double, ax: Double, ay: Double)
open fun cubicTo(c1x: Float, c1y: Float, c2x: Float, c2y: Float, ax: Float, ay: Float)
open fun cubicTo(c1x: Int, c1y: Int, c2x: Int, c2y: Int, ax: Int, ay: Int)
Link copied to clipboard
open fun curve(curve: Bezier)
Link copied to clipboard
open fun curves(curves: Curves)
open fun curves(curves: List<Curves>)
Link copied to clipboard
open override fun dispose()
Link copied to clipboard
fun draw(d: Drawable)
Link copied to clipboard
Link copied to clipboard
open fun drawImage(image: Bitmap, pos: Point, size: Size = image.size.toFloat())
Link copied to clipboard
fun Context2d.drawRichText(text: RichTextData, bounds: Rectangle = Rectangle(0, 0, width, height), wordWrap: Boolean = true, includePartialLines: Boolean = false, ellipsis: String? = null, fill: Paint? = null, stroke: Stroke? = null, align: TextAlignment = TextAlignment.TOP_LEFT, includeFirstLineAlways: Boolean = true, textRangeStart: Int = 0, textRangeEnd: Int = Int.MAX_VALUE): Int
Link copied to clipboard
fun drawShape(shape: Drawable, rasterizerMethod: ShapeRasterizerMethod = ShapeRasterizerMethod.X4, native: Boolean = true)
Link copied to clipboard
fun <T> drawText(text: T, pos: Point = Point.ZERO, fill: Boolean = true, paint: Paint? = null, font: Font? = this.font, size: Double = this.fontSize, renderer: TextRenderer<T> = DefaultStringTextRenderer as TextRenderer<T>, align: TextAlignment = this.alignment, outMetrics: TextMetricsResult? = null, fillStyle: Paint? = null, stroke: Stroke? = null, textRangeStart: Int = 0, textRangeEnd: Int = Int.MAX_VALUE): TextMetricsResult?
Link copied to clipboard
open fun ellipse(ellipse: Ellipse)
open fun ellipse(bounds: Rectangle)
open fun ellipse(center: Point, radius: Size)
Link copied to clipboard
fun fill(winding: Winding? = null)
fun fill(paint: Paint?, winding: Winding? = null)
inline fun fill(paint: Paint, begin: Boolean = true, winding: Winding? = null, block: () -> Unit)
inline fun fill(color: RGBA, alpha: Double, begin: Boolean = true, winding: Winding? = null, block: () -> Unit)
Link copied to clipboard
fun fillRect(x: Double, y: Double, width: Double, height: Double)
inline fun fillRect(x: Number, y: Number, width: Number, height: Number)
Link copied to clipboard
inline fun fillRoundRect(x: Number, y: Number, width: Number, height: Number, rx: Number, ry: Number = rx)
Link copied to clipboard
inline fun fillStroke(fill: Paint?, stroke: Stroke?, callback: () -> Unit = {})
inline fun fillStroke(fill: Paint?, stroke: Paint?, strokeInfo: StrokeInfo? = null, callback: () -> Unit = {})
Link copied to clipboard
inline fun fillStyle(paint: Paint, callback: () -> Unit)
Link copied to clipboard
fun fillText(text: String, pos: Point)
inline fun fillText(text: String, pos: Point, font: Font? = this.font, size: Number = this.fontSize, align: TextAlignment = this.alignment, color: Paint? = null)
Link copied to clipboard
inline fun font(font: Font? = this.font, align: TextAlignment = this.alignment, size: Double = this.fontSize, callback: () -> Unit)
Link copied to clipboard
Link copied to clipboard
fun getTextBounds(text: String, out: TextMetrics = TextMetrics(), fontSize: Double = this.fontSize, renderer: TextRenderer<String> = DefaultStringTextRenderer, align: TextAlignment = this.alignment): TextMetrics
Link copied to clipboard
open fun isEmpty(): Boolean
Link copied to clipboard
open fun isNotEmpty(): Boolean
Link copied to clipboard
inline fun keep(callback: () -> Unit)
Link copied to clipboard
inline fun keepApply(callback: Context2d.() -> Unit): Context2d
Link copied to clipboard
inline fun keepTransform(callback: () -> Unit)
Link copied to clipboard
open fun line(p0: Point, p1: Point)
Link copied to clipboard
inline fun lineDash(lineDash: DoubleList?, lineDashOffset: Double = 0.0, callback: () -> Unit)
Link copied to clipboard
open override fun lineTo(p: Point)
open fun lineTo(x: Double, y: Double)
open fun lineTo(x: Float, y: Float)
open fun lineTo(x: Int, y: Int)
Link copied to clipboard
open fun lineToH(x: Double)
Link copied to clipboard
open fun lineToV(y: Double)
Link copied to clipboard
open override fun moveTo(p: Point)
open fun moveTo(x: Double, y: Double)
open fun moveTo(x: Float, y: Float)
open fun moveTo(x: Int, y: Int)
Link copied to clipboard
open fun moveToH(x: Double)
Link copied to clipboard
open fun moveToV(y: Double)
Link copied to clipboard
open fun parallelogram(bounds: Rectangle, angle: Angle, direction: Boolean)
Link copied to clipboard
fun path(path: VectorPath)
Link copied to clipboard
fun VectorBuilder.pathSvg(path: String, m: Matrix = Matrix.NIL)
Link copied to clipboard
open fun polygon(path: PointList, close: Boolean)
open fun polygon(vararg path: Point, close: Boolean)
open fun polygon(path: List<Point>, close: Boolean)
Link copied to clipboard
open fun polyline(points: PointList, close: Boolean)
open fun polyline(vararg points: Point, close: Boolean)
open fun polyline(points: List<Point>, close: Boolean)
Link copied to clipboard
open fun quad(o: Point, c: Point, a: Point)
Link copied to clipboard
open override fun quadTo(c: Point, a: Point)
open fun quadTo(cx: Double, cy: Double, ax: Double, ay: Double)
open fun quadTo(cx: Float, cy: Float, ax: Float, ay: Float)
open fun quadTo(cx: Int, cy: Int, ax: Int, ay: Int)
Link copied to clipboard
open fun rCubicTo(c1: Point, c2: Point, a: Point)
open fun rCubicTo(c1: Point, c2: Point, a: Point, relative: Boolean)
Link copied to clipboard
open fun rect(rect: Rectangle)
open fun rect(rect: RectangleInt)
open fun rect(pos: Point, size: Size)
open fun rect(x: Double, y: Double, width: Double, height: Double)
open fun rect(x: Float, y: Float, width: Float, height: Float)
open fun rect(x: Int, y: Int, width: Int, height: Int)
Link copied to clipboard
open fun rectHole(rect: Rectangle)
open fun rectHole(x: Double, y: Double, width: Double, height: Double)
open fun rectHole(x: Float, y: Float, width: Float, height: Float)
open fun rectHole(x: Int, y: Int, width: Int, height: Int)
Link copied to clipboard
open fun regularPolygon(points: Int, radius: Double, rotated: Angle, x: Double, y: Double)
Link copied to clipboard
open fun regularPolygonHole(points: Int, radius: Double, rotated: Angle, x: Double, y: Double)
Link copied to clipboard
fun restore()
Link copied to clipboard
open fun rLineTo(delta: Point)
open fun rLineTo(a: Point, relative: Boolean)
Link copied to clipboard
open fun rLineToH(x: Double)
open fun rLineToH(x: Double, relative: Boolean)
Link copied to clipboard
open fun rLineToHV(value: Double, horizontal: Boolean)
Link copied to clipboard
open fun rLineToV(y: Double)
open fun rLineToV(y: Double, relative: Boolean)
Link copied to clipboard
open fun rMoveTo(delta: Point)
open fun rMoveTo(a: Point, relative: Boolean)
Link copied to clipboard
open fun rMoveToH(x: Double)
open fun rMoveToH(x: Double, relative: Boolean)
Link copied to clipboard
open fun rMoveToHV(value: Double, horizontal: Boolean)
Link copied to clipboard
open fun rMoveToV(y: Double)
open fun rMoveToV(y: Double, relative: Boolean)
Link copied to clipboard
fun rotate(angle: Angle)
inline fun rotate(angle: Angle, block: () -> Unit)
Link copied to clipboard
open fun roundRect(rect: RoundRectangle)
open fun roundRect(x: Double, y: Double, w: Double, h: Double, rx: Double, ry: Double)
open fun roundRect(x: Float, y: Float, w: Float, h: Float, rx: Float, ry: Float)
open fun roundRect(x: Int, y: Int, w: Int, h: Int, rx: Int, ry: Int)
open fun roundRect(x: Double, y: Double, w: Double, h: Double, rtl: Double, rtr: Double, rbr: Double, rbl: Double)
Link copied to clipboard
open fun rQuadTo(c: Point, a: Point)
open fun rQuadTo(c: Point, a: Point, relative: Boolean)
Link copied to clipboard
fun save()
Link copied to clipboard
fun scale(sx: Double, sy: Double = sx)
inline fun scale(sx: Int, sy: Int = sx)
inline fun scale(sx: Number, sy: Number = sx)
inline fun scale(sx: Number, sy: Number = sx, block: () -> Unit)
Link copied to clipboard
fun setTransform(a: Double, b: Double, c: Double, d: Double, tx: Double, ty: Double)
Link copied to clipboard
fun shear(sx: Double, sy: Double)
Link copied to clipboard
fun skew(skewX: Angle = 0.degrees, skewY: Angle = 0.degrees)
inline fun skew(skewX: Angle = Angle.ZERO, skewY: Angle = Angle.ZERO, block: () -> Unit)
Link copied to clipboard
open fun star(points: Int, radiusSmall: Double, radiusBig: Double, rotated: Angle, x: Double, y: Double)
Link copied to clipboard
open fun starHole(points: Int, radiusSmall: Double, radiusBig: Double, rotated: Angle, x: Double, y: Double)
Link copied to clipboard
fun stroke()
fun stroke(paint: Paint)
inline fun stroke(stroke: Stroke?, begin: Boolean = true, callback: () -> Unit = {})
inline fun stroke(paint: Paint?, info: StrokeInfo?, begin: Boolean = true, callback: () -> Unit = {})
inline fun stroke(paint: Paint, lineWidth: Number = this.lineWidth, lineCap: LineCap = this.lineCap, lineJoin: LineJoin = this.lineJoin, miterLimit: Number = this.miterLimit, lineDash: DoubleList? = this.lineDash, lineDashOffset: Number = this.lineDashOffset, begin: Boolean = true, callback: () -> Unit = {})
Link copied to clipboard
fun strokeDot(x: Double, y: Double)
Link copied to clipboard
fun strokeRect(x: Double, y: Double, width: Double, height: Double)
inline fun strokeRect(x: Number, y: Number, width: Number, height: Number)
Link copied to clipboard
inline fun strokeStyle(paint: Paint, callback: () -> Unit)
Link copied to clipboard
fun strokeText(text: String, pos: Point)
Link copied to clipboard
fun <T> VectorBuilder.text(text: T, font: VectorFont, textSize: Double = 16.0, pos: Point = Point.ZERO, align: TextAlignment = TextAlignment.BASELINE_LEFT, renderer: TextRenderer<T> = DefaultStringTextRenderer as TextRenderer<T>)
Link copied to clipboard
fun transform(a: Double, b: Double, c: Double, d: Double, tx: Double, ty: Double)
Link copied to clipboard
open fun <T> transformed(m: Matrix, block: VectorBuilder.() -> T): T
Link copied to clipboard
inline fun translate(pos: Point)
fun translate(tx: Double, ty: Double)
inline fun translate(tx: Int, ty: Int)
inline fun translate(tx: Number, ty: Number)
inline fun translate(tx: Number, ty: Number, block: () -> Unit)
Link copied to clipboard
fun unclip()
Link copied to clipboard
fun withScaledRenderer(scaleX: Float, scaleY: Float = scaleX): Context2d
Link copied to clipboard
open fun write(curves: Curves)
open fun write(curves: List<Curves>)