Class: Htmltex

Htmltex()

new Htmltex()

Rendering html content as dynamic texture.

This system take each entity with one and only one html content, then rendering to multiple THREE.Object3D in scene with help of xv.ecs.sys.Thrender.

Htmltex is an extension of ECS.subsystems. User must add it to ECS explicitly. To create a new instance, entities definition must provided as options arg of constructor.

These definition can be generated with help of Htmltex.createEntityDefs() For exmaple, see htmltex.case.js

Source:

Methods

(static) createEntityDefs(options) → {array.<object>}

Parameters:
Name Type Description
options object

options.objcanvas: array of [{domId, eid, texsize, visual}]
where
objcanvas.domId: string - canvs id for texture
objcanvas.eid: string - optinal
objcanvas.texsize: {width, height} - optinal, default 256x256
objcanvas.visual: {vtype: AssetType} - optional, default AssetType.DomCanvas
Other types are not supported.

Source:
Returns:

entity definitions

Type
array.<object>

(static) h5uuid()

Source:

refresh(tick, entities)

Parameters:
Name Type Description
tick int
entities Array.<Entity>
Source:

refresh(htmlId, onRefresh)

Reload a Canvas texture from html, which will be updated atuomatically when it's ready.

Parameters:
Name Type Description
htmlId string
onRefresh function
Source:

Htmltex(ecs, options)

new Htmltex(ecs, options)

Parameters:
Name Type Description
ecs ECS
options object
Source:

Methods

(static) createEntityDefs(options) → {array.<object>}

Parameters:
Name Type Description
options object

options.objcanvas: array of [{domId, eid, texsize, visual}]
where
objcanvas.domId: string - canvs id for texture
objcanvas.eid: string - optinal
objcanvas.texsize: {width, height} - optinal, default 256x256
objcanvas.visual: {vtype: AssetType} - optional, default AssetType.DomCanvas
Other types are not supported.

Source:
Returns:

entity definitions

Type
array.<object>

(static) h5uuid()

Source:

refresh(tick, entities)

Parameters:
Name Type Description
tick int
entities Array.<Entity>
Source:

refresh(htmlId, onRefresh)

Reload a Canvas texture from html, which will be updated atuomatically when it's ready.

Parameters:
Name Type Description
htmlId string
onRefresh function
Source: