Skip to main content

Renderer

Renderer

Overview needed


Constructor

public Renderer

new Renderer(canvas)

*Description needed*

Parameters

  •  canvas: HTMLCanvasElementDescription needed

Properties

No publicly accessible properties on Renderer

private canvas: HTMLCanvasElement

Description needed

private context: CanvasRenderingContext2D

Description needed


Methods

public setCursor

setCursor(cursor) => void

Description needed

Parameters

  •  cursor: stringDescription needed

public getSize

getSize() => Vector

Description needed

Returns

  •   VectorDescription needed

public clear

clear() => void

Description needed

public save

save() => void

Description needed

public restore

restore() => void

Description needed

public transform

transform(camera, transform) => void

Description needed

Parameters

  •  camera: CameraDescription needed

  •  transform: TransformDescription needed

public translate

translate(v) => void

Description needed

Parameters

  •  v: VectorDescription needed

public rotate

rotate(a) => void

Description needed

Parameters

  •  a: numberDescription needed

public beginPath

beginPath() => void

Description needed

public closePath

closePath() => void

Description needed

public stroke

stroke() => void

Description needed

public draw

draw(shape, style, alpha) => void

Description needed

Parameters

  •  shape: ShapeDescription needed

  •  style: StyleDescription needed

  •  alpha: numberDescription needed

public image

image(img, pos, size, tint) => void

Description needed

Parameters

  •  img: SVGDrawingDescription needed

  •  pos: VectorDescription needed

  •  size: VectorDescription needed

  •  tint: stringDescription needed

public text

text(txt, pos, textAlign, color, font, textBaseline, angle) => void

Description needed

Parameters

  •  txt: stringDescription needed

  •  pos: VectorDescription needed

  •  textAlign: "center" | "end" | "left" | "right" | "start"Description needed

  •  color: stringDescription needed

  •  font: stringDescription needed

  •  textBaseline: "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top"Description needed

  •  angle: numberDescription needed

public createRadialGradient

createRadialGradient(pos1, r1, pos2, r2) => CanvasGradient

Description needed

Parameters

  •  pos1: VectorDescription needed

  •  r1: numberDescription needed

  •  pos2: VectorDescription needed

  •  r2: numberDescription needed

Returns

  •   CanvasGradientDescription needed

public getTextWidth

getTextWidth(txt) => number

Description needed

Parameters

  •  txt: stringDescription needed

Returns

  •   numberDescription needed

public moveTo

moveTo(p) => void

Description needed

Parameters

  •  p: VectorDescription needed

public lineTo

lineTo(p) => void

Description needed

Parameters

  •  p: VectorDescription needed

public lineWith

lineWith(p) => void

Description needed

Parameters

  •  p: VectorDescription needed

public hLine

hLine(pos, len, align) => void

Description needed

Parameters

  •  pos: VectorDescription needed

  •  len: numberDescription needed

  •  align: "center" | "left"Description needed

public hLines

hLines(ys, x0, len, align) => void

Description needed

Parameters

  •  ys: number[]Description needed

  •  x0: numberDescription needed

  •  len: numberDescription needed

  •  align: "center" | "left"Description needed

public strokeHLines

strokeHLines(args) => void

Description needed

Parameters

  •  args: [ys: number[], x0: number, len: number, align: "center" | "left"]<number[], number, number, "center" | "left">Description needed

public vLine

vLine(pos, len, baseline) => void

Description needed

Parameters

  •  pos: VectorDescription needed

  •  len: numberDescription needed

  •  baseline: "bottom" | "middle"Description needed

public vLines

vLines(xs, y0, len, baseline) => void

Description needed

Parameters

  •  xs: number[]Description needed

  •  y0: numberDescription needed

  •  len: numberDescription needed

  •  baseline: "bottom" | "middle"Description needed

public strokeVLines

strokeVLines(args) => void

Description needed

Parameters

  •  args: [xs: number[], y0: number, len: number, baseline: "bottom" | "middle"]<number[], number, number, "bottom" | "middle">Description needed

public pathLine

pathLine(p1, p2) => void

Description needed

Parameters

  •  p1: VectorDescription needed

  •  p2: VectorDescription needed

public strokePath

strokePath(path) => void

Description needed

Parameters

  •  path: Vector[]Description needed

public setPathStyle

setPathStyle(style) => void

Description needed

Parameters

  •  style: PartialDescription needed

public setStyle

setStyle(style, alpha) => void

Description needed

Parameters

  •  style: StyleDescription needed

  •  alpha: numberDescription needed


Static Methods

No static methods for Renderer