Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Renderer

Index

Constructors

constructor

  • new Renderer(canvas: HTMLCanvasElement): Renderer
  • Parameters

    • canvas: HTMLCanvasElement

    Returns Renderer

Properties

canvas

canvas: HTMLCanvasElement

context

context: CanvasRenderingContext2D

frameCount

frameCount: number = 0

height

height: number

mouse

mouse: { click: boolean; dblclick: boolean; down: boolean; move: boolean; out: boolean; over: boolean; press: boolean; px: number; py: number; up: boolean; x: number; y: number } = ...

Type declaration

  • click: boolean
  • dblclick: boolean
  • down: boolean
  • move: boolean
  • out: boolean
  • over: boolean
  • press: boolean
  • px: number
  • py: number
  • up: boolean
  • x: number
  • y: number

width

width: number

Methods

alpha

  • alpha(a: number): void
  • Parameters

    • a: number

    Returns void

arc

  • arc(arc: Arc): any
  • arc(x: number, y: number, r: number, start: number, end: number): any
  • Parameters

    Returns any

  • Parameters

    • x: number
    • y: number
    • r: number
    • start: number
    • end: number

    Returns any

background

  • background(c: string): void
  • Parameters

    • c: string

    Returns void

beginPath

  • beginPath(): void
  • Returns void

bezier

  • bezier(x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number): void
  • Parameters

    • x1: number
    • y1: number
    • cx1: number
    • cy1: number
    • cx2: number
    • cy2: number
    • x2: number
    • y2: number

    Returns void

bezierTo

  • bezierTo(cx1: number, cy1: number, cx2: number, cy2: number, x: number, y: number): void
  • Parameters

    • cx1: number
    • cy1: number
    • cx2: number
    • cy2: number
    • x: number
    • y: number

    Returns void

cell

  • cell(cell: Cell): void
  • Parameters

    Returns void

circle

  • circle(circle: Circle): any
  • circle(x: number, y: number, r: number): any
  • Parameters

    Returns any

  • Parameters

    • x: number
    • y: number
    • r: number

    Returns any

clear

  • clear(): void
  • clear(c: string): void
  • Returns void

  • Parameters

    • c: string

    Returns void

dashOffset

  • dashOffset(offset: number): void
  • Parameters

    • offset: number

    Returns void

dataURL

  • dataURL(): string
  • Returns string

draw

  • draw(f: Function): void
  • Parameters

    • f: Function

    Returns void

ellipse

  • ellipse(x: number, y: number, rx: number, ry: number, a?: number): void
  • Parameters

    • x: number
    • y: number
    • rx: number
    • ry: number
    • a: number = 0

    Returns void

endPath

  • endPath(close?: boolean): void
  • Parameters

    • close: boolean = false

    Returns void

fill

  • fill(c?: string | boolean): void
  • Parameters

    • c: string | boolean = true

    Returns void

fontFamily

  • fontFamily(family: string): void
  • Parameters

    • family: string

    Returns void

fontSize

  • fontSize(size: number): void
  • Parameters

    • size: number

    Returns void

fontStyle

  • fontStyle(style: string): void
  • Parameters

    • style: string

    Returns void

fontWeight

  • fontWeight(weight: string): void
  • Parameters

    • weight: string

    Returns void

image

  • image(img: CanvasImageSource, x: number, y: number, w: number, h: number): void
  • Parameters

    • img: CanvasImageSource
    • x: number
    • y: number
    • w: number
    • h: number

    Returns void

line

  • line(line: Line): any
  • line(p1: Point, p2: Point): any
  • line(x1: number, y1: number, x2: number, y2: number): any
  • Parameters

    Returns any

  • Parameters

    Returns any

  • Parameters

    • x1: number
    • y1: number
    • x2: number
    • y2: number

    Returns any

lineCap

  • lineCap(cap: CanvasLineCap): void
  • Parameters

    • cap: CanvasLineCap

    Returns void

lineDash

  • lineDash(segments: boolean | number[]): void
  • Parameters

    • segments: boolean | number[]

    Returns void

lineJoin

  • lineJoin(join: CanvasLineJoin): void
  • Parameters

    • join: CanvasLineJoin

    Returns void

lineTo

  • lineTo(x: number, y: number): void
  • Parameters

    • x: number
    • y: number

    Returns void

lineWidth

  • lineWidth(w: number): void
  • Parameters

    • w: number

    Returns void

loop

  • loop(loop?: boolean): void
  • Parameters

    • loop: boolean = true

    Returns void

measureText

  • measureText(text: string): number
  • Parameters

    • text: string

    Returns number

moveTo

  • moveTo(x: number, y: number): void
  • Parameters

    • x: number
    • y: number

    Returns void

off

  • off(event: string, f: EventListener): void
  • Parameters

    • event: string
    • f: EventListener

    Returns void

on

  • on(event: string, f: EventListener, options?: any): void
  • Parameters

    • event: string
    • f: EventListener
    • options: any = false

    Returns void

onMouse

  • onMouse(mouse?: boolean): void
  • Parameters

    • mouse: boolean = true

    Returns void

point

  • point(p: Point): any
  • point(x: number, y: number): any
  • Parameters

    Returns any

  • Parameters

    • x: number
    • y: number

    Returns any

polygon

  • polygon(polygon: Polygon): any
  • polygon(points: Point[]): any
  • Parameters

    Returns any

  • Parameters

    Returns any

polyline

  • polyline(polyline: Polyline): any
  • polyline(points: Point[]): any
  • Parameters

    Returns any

  • Parameters

    Returns any

quad

  • quad(p1: Point, p2: Point, p3: Point, p4: Point): any
  • quad(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number): any
  • Parameters

    Returns any

  • Parameters

    • x1: number
    • y1: number
    • x2: number
    • y2: number
    • x3: number
    • y3: number
    • x4: number
    • y4: number

    Returns any

quadraticBezier

  • quadraticBezier(x1: number, y1: number, cx1: number, cy1: number, x2: number, y2: number): void
  • Parameters

    • x1: number
    • y1: number
    • cx1: number
    • cy1: number
    • x2: number
    • y2: number

    Returns void

quadraticBezierTo

  • quadraticBezierTo(cx: number, cy: number, x: number, y: number): void
  • Parameters

    • cx: number
    • cy: number
    • x: number
    • y: number

    Returns void

rect

  • rect(rect: Rect): any
  • rect(x: number, y: number, w: number, h: number): any
  • Parameters

    Returns any

  • Parameters

    • x: number
    • y: number
    • w: number
    • h: number

    Returns any

restore

  • restore(): void
  • Returns void

rotate

  • rotate(a: number): void
  • Parameters

    • a: number

    Returns void

save

  • save(): void
  • Returns void

scale

  • scale(x: number, y: number): void
  • Parameters

    • x: number
    • y: number

    Returns void

sector

  • sector(sector: Sector): any
  • sector(x: number, y: number, r1: number, r2: number, start: number, end: number): any
  • Parameters

    Returns any

  • Parameters

    • x: number
    • y: number
    • r1: number
    • r2: number
    • start: number
    • end: number

    Returns any

setTransform

  • setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void
  • Parameters

    • a: number
    • b: number
    • c: number
    • d: number
    • e: number
    • f: number

    Returns void

size

  • size(w: number, h: number): void
  • Parameters

    • w: number
    • h: number

    Returns void

spline

  • spline(spline: Point[] | Spline, mode?: string, detail?: number): void
  • Parameters

    • spline: Point[] | Spline
    • mode: string = 'clamped'
    • detail: number = 20

    Returns void

stroke

  • stroke(c?: string | boolean): void
  • Parameters

    • c: string | boolean = true

    Returns void

text

  • text(text: string, x: number, y: number): void
  • Parameters

    • text: string
    • x: number
    • y: number

    Returns void

textAlign

  • textAlign(align: CanvasTextAlign): void
  • Parameters

    • align: CanvasTextAlign

    Returns void

textBaseline

  • textBaseline(baseline: CanvasTextBaseline): void
  • Parameters

    • baseline: CanvasTextBaseline

    Returns void

transform

  • transform(a: number, b: number, c: number, d: number, e: number, f: number): void
  • Parameters

    • a: number
    • b: number
    • c: number
    • d: number
    • e: number
    • f: number

    Returns void

translate

  • translate(x: number, y: number): void
  • Parameters

    • x: number
    • y: number

    Returns void

triangle

  • triangle(triangle: Triangle): any
  • triangle(p1: Point, p2: Point, p3: Point): any
  • triangle(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): any
  • Parameters

    Returns any

  • Parameters

    Returns any

  • Parameters

    • x1: number
    • y1: number
    • x2: number
    • y2: number
    • x3: number
    • y3: number

    Returns any