Editor

core/Editor~ Editor

new Editor(world, options)

Source:
Parameters:
Name Type Description
world module:core/World~World World to edit
options object Options to configure editor
Name Type Attributes Default Description
autosave boolean <optional>
true Flag to enable auto saving functionality
Examples

Create an editor and add a voxel

const Voxelcss = require('voxelcss');
let scene = new Voxelcss.Scene();
let world = new Voxelcss.World(scene);
scene.attach(document.body);
let editor = new Voxelcss.Editor(world);
let position = [10, 10, 10];
let size = 100;
editor.add(new Voxelcss.Voxel(position, size));

Add a voxel with grass mesh

let mesh = Voxelcss.meshes.grass;
let grass = new Voxelcss.Voxel(position, size, {mesh});
editor.add(grass);