Gretro-text is a gretro plugin to draw a text.
include gretro-text.js after including gretro.js
<script src="gretro.js"></script>
<script src="gretro-text.js"></script>gretro-text is available on npm.
$ npm install gretro-textvar gretro = require("gretro");
var gretroText = require("gretro-text");
gretro.use(gretroText);Draws a 5x7 character to the canvas.
canvas.char(ch, x, y);- ch: int
- ascii code (0x21 <= ch <= 0x7e)
- x: int
- x-coordinate of the character
- y: int
- y-coordinate of the character
Canvas: self for method chaining
Draws a text to the canvas.
canvas.text(text, x, y);- text: string
- x: int
- x-coordinate of the text
- y: int
- y-coordinate of the text
Canvas: self for method chaining
