npm

Need private packages and team management tools?Check out npm Orgs. »

text-maze-render

1.1.3 • Public • Published

Text Maze Render

Rendering functions for mazes created with the text-maze package. Rendering is via the HTML Canvas API.

See it in use: https://littlesystem.com/maze

Install

npm install --save text-maze-render

Usage

Render a text maze with either the blocky, bordered or walled rendering function.

var tm  = require('text-maze');
var tmr = require('text-maze-render');
 
var maze = tm("I don't know half of you half as well as I should like.");
 
tmr.blocky(maze.maze, {
    cellSize: maze.cellSize,
    endpoints: maze.endpoints,
    showText: true,
    showSolution: true
});

Put a canvas tag in your HTML with an id of text-maze.

<canvas id="text-maze">

Bundle your code with something like browserify.

browserify code.js -o bundle.js

Load the bundle in your HTML.

<script src="path/to/bundle.js"></script>

install

npm i text-maze-render

Downloadsweekly downloads

3

version

1.1.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability