new Screen(cols, rows, options)
Constructs monochromatic screen instance. Handles chip8 output. This class should be treated as abstract class. It implements logic but does not perform any rendering.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
cols |
number | number of colums |
|
rows |
number | number of rows |
|
options |
object |
<optional> |
additional options |
- Source:
Methods
-
<static> extend(obj) → {function}
-
Extends abstract screen. Extending object should implement render method and optionally initialize method which works as constructor.
Parameters:
Name Type Description obj
object object which extends base functionality.
- Source:
Returns:
new constructor.
- Type
- function
-
clear()
-
Clears internal screen representation.
- Source:
-
repaint()
-
Does repaint. Implement in subclass.
- Source:
-
togglePixel(x, y) → {boolean}
-
Toggles pixel at location (x, y).
Parameters:
Name Type Description x
number y
number - Source:
Returns:
true if collision occurs, false otherwise.
- Type
- boolean