circuit-boards

1.0.1 • Public • Published

Circuit Boards

A Node package for generating seamless tiles that resemble circuit boards. You can play with the settings on my web site or just clone this.

circuit boards screenshot

I'll be using this in a game I'm developing.

Examples

A basic example:

{createCanvas} = require 'canvas'
{draw} = require 'circuit-boards'
fs = require 'fs'

canvas = createCanvas 128, 128
opts =
  size: 128
stopDraw = draw canvas, opts, ->
  out = fs.createWriteStream __dirname + '/text.png'
  stream = canvas.pngStream()
  stream.on 'data', (chunk) -> out.write chunk
  stream.on 'end', -> console.log 'saved'

# Stop early. The draw callback isn't called.
#setTimeout (-> stopDraw ->), 1000

Generate an image for all the styles:

./node_modules/.bin/coffee examples/doAll.coffee

License

AGPL

Package Sidebar

Install

npm i circuit-boards

Weekly Downloads

4

Version

1.0.1

License

MIT

Unpacked Size

97.7 kB

Total Files

16

Last publish

Collaborators

  • paul-nechifor