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.
Install with npm
npm install voxel-painter-core --save
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.
Set the color of the painter
painter.setColor('#F15501')
To get the currently used color: painter.color()
painter.showGrid(boolean)
painter.setWireframe(boolean)
BSD