Class: CanvasScreen

chip8. CanvasScreen

new CanvasScreen(cols, rows, options)

Renders to canvas.

Parameters:
Name Type Description
cols number

number of colums

rows number

number of rows

options object

additional options

Properties
Name Type Argument Description
ctx object

canvas context

drawGrid boolean <optional>

true if pixel grid should be rendered (default: true)

bgColor string <optional>

background color (default: #080808)

fgColor string <optional>

foreground color (default: #FFF)

gridColor string <optional>

grid color (default: #121212)

Source:

Extends

Methods

clear()

Clears internal screen representation.

Inherited From:
Source:

repaint()

Repaints screen.

Source:

togglePixel(x, y) → {boolean}

Toggles pixel at location (x, y).

Parameters:
Name Type Description
x number
y number
Inherited From:
Source:
Returns:

true if collision occurs, false otherwise.

Type
boolean