Class: VoxelManager

VoxelManager()

The main driving component for the application. Sets up the rest of the user interface and directly communicates with the Voxel.js module.

Constructor

new VoxelManager()

Source:

Extends

  • React.Component

Members

onGetBrushAction

Handler for when Brush components want to know the current brush action in the editor.

Source:

onGetBrushType

Handler for when Brush components want to know the current brush type in the editor.

Source:

Methods

createVoxelWorld(canvasRef)

Takes the given canvas Ref and renders the voxel world.

Parameters:
Name Type Description
canvasRef Ref
Source:

getCallbacksObject() → {Object}

Returns callbacks organized by the component that they are meant for.

Source:
Returns:
Type
Object

onAddColor()

Tell the VoxelEditor that the user added a new color to their color palette

Source:

onExportImage(imageName) → {Canvas}

Handler used to export the current frame from the canvas as an image.

Parameters:
Name Type Description
imageName string

What to name the exported image

Source:
Returns:

The canvas to take a screenshot from

Type
Canvas

onExportModel(name, type)

Exports the voxel model to some 3D file format.

Parameters:
Name Type Description
name string

What the exported file should be called

type string

The type of file to export

Source:

onGetColorData() → {Array.Color}

Returns color palette data from the VoxelWorld.

Source:
Returns:
Type
Array.Color

onGetProjectData() → {Object}

Gets project data from the currently open project.

Source:
Returns:

JavaScript object representing the relevant data from the currently open project/scene.

Type
Object

onLoadProjectData(projectData)

Handler used to load a new scene from the given project data.

Parameters:
Name Type Description
projectData Object
Source:

onNewProject()

Loads a fresh, blank project.

Source:

onNewSelectedColor(index)

Tells the VoxelEditor what color of voxel the user is placing/painting now.

Parameters:
Name Type Description
index number
Source:

onSelectedColorChange(index, color)

Called whenever a new color is selected.

Parameters:
Name Type Description
index number

Index of the changed color

color Object
Source:

setBrushAction(brushAction)

Changes the brush action currently being used.

Parameters:
Name Type Description
brushAction string

brush action to set

Source:

setBrushType(brushType)

Changes the brush type currently being used.

Parameters:
Name Type Description
brushType string
Source: