Renderer
Renderer
Overview needed
Constructor
public Renderer
new Renderer(canvas)
*Description needed*Parameters
-
canvas: HTMLCanvasElement
– Description 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: string
– Description needed
public transform
transform(camera, transform) => void
Description needed
Parameters
camera: Camera
– Description neededtransform: Transform
– Description needed
public image
image(img, pos, size, tint) => void
Description needed
Parameters
img: SVGDrawing
– Description neededpos: Vector
– Description neededsize: Vector
– Description neededtint: string
– Description needed
public text
text(txt, pos, textAlign, color, font, textBaseline, angle) => void
Description needed
Parameters
txt: string
– Description neededpos: Vector
– Description neededtextAlign: "center" | "end" | "left" | "right" | "start"
– Description neededcolor: string
– Description neededfont: string
– Description neededtextBaseline: "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top"
– Description neededangle: number
– Description needed
public createRadialGradient
createRadialGradient(pos1, r1, pos2, r2) => CanvasGradient
Description needed
Parameters
pos1: Vector
– Description neededr1: number
– Description neededpos2: Vector
– Description neededr2: number
– Description needed
Returns
-
CanvasGradient
– Description needed
public getTextWidth
getTextWidth(txt) => number
Description needed
Parameters
-
txt: string
– Description needed
Returns
-
number
– Description needed
public hLine
hLine(pos, len, align) => void
Description needed
Parameters
pos: Vector
– Description neededlen: number
– Description neededalign: "center" | "left"
– Description needed
public hLines
hLines(ys, x0, len, align) => void
Description needed
Parameters
ys: number[]
– Description neededx0: number
– Description neededlen: number
– Description neededalign: "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: Vector
– Description neededlen: number
– Description neededbaseline: "bottom" | "middle"
– Description needed
public vLines
vLines(xs, y0, len, baseline) => void
Description needed
Parameters
xs: number[]
– Description neededy0: number
– Description neededlen: number
– Description neededbaseline: "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: Vector
– Description neededp2: Vector
– Description needed
public strokePath
strokePath(path) => void
Description needed
Parameters
-
path: Vector[]
– Description needed
public setPathStyle
setPathStyle(style) => void
Description needed
Parameters
-
style: Partial
– Description needed
public setStyle
setStyle(style, alpha) => void
Description needed
Parameters
style: Style
– Description neededalpha: number
– Description needed
Static Methods
No static methods for Renderer