Reference Source
import EntityRender from 'minerender/src/entity/index.js'
public class | source

EntityRender

Extends:

Render → EntityRender

A renderer for Minecraft entities

Constructor Summary

Public Constructor
public

constructor(options: Object, element: HTMLElement)

Member Summary

Public Members
public
public

entities: *[]

public

Method Summary

Public Methods
public

render(entities: *, cb: *)

Inherited Summary

From class Render
public

element: HTMLElement

DOM Element to attach the renderer to

public

options: {

Combined options

public
public

addToScene(toAdd: *)

Adds an object to the scene & sets userData.renderType to this renderer's type

public

clearScene(onlySelfType: *, filterFn: *)

Clears the scene

public
public

toGLTF(exportOptions: *): Promise<any>

Export the current scene content in the .gltf format (geometries + textures)

public

toImage(trim: boolean, mime: string): string

public

Export the current scene content in the .obj format (only geometries, no textures)

public

toPLY(exportOptions: *): *

protected

initScene(renderCb: *, doNotAnimate: *): boolean

Initializes the scene

Public Constructors

public constructor(options: Object, element: HTMLElement) source

Override:

Render#constructor

Params:

NameTypeAttributeDescription
options Object
  • optional

The options for this renderer, see defaultOptions

options.assetRoot string
  • optional
  • default: DEFAULT_ROOT

root to get asset files from

element HTMLElement
  • optional
  • default: document.body

DOM Element to attach the renderer to - defaults to document.body

Public Members

public attached: boolean source

public entities: *[] source

public renderType: string source

Override:

Render#renderType

Public Methods

public render(entities: *, cb: *) source

Params:

NameTypeAttributeDescription
entities *
cb *