voxel-painter-core

0.0.5 • Public • Published

Voxel Painter Core

Work In Progress

Extracted from Voxel Painter by Max Ogden. The goal is to make it a base module decoupled from any DOM so it can be used anywhere, and in the future add a way to create add-ons to extend or add some features.

NPM

Installation

Install with npm

npm install voxel-painter-core --save

Basic Usage

Use Browserify to bundle your code:

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <style>
        #voxel-painter {
            height: 1000px;
        }
    </style> 
</head>
<body>
    <div id="voxel-painter"></div>
    <script src="bundle.js"></script> 
</body>
</html>
var voxelPainter = require('voxel-painter-core')
 
// Options
var options = {
    container: '#voxel-painter'
}
 
var painter = voxelPainter(options)

For a working example check out the example directory.

Methods

Set color

Set the color of the painter

painter.setColor('#F15501')

To get the currently used color: painter.color()

Show / hide grid

painter.showGrid(boolean)

Set wireframe

painter.setWireframe(boolean)

License

BSD

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.5
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.5
    1
  • 0.0.4
    0
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i voxel-painter-core

Weekly Downloads

1

Version

0.0.5

License

BSD

Last publish

Collaborators

  • romainberger