HtmlComponent

HtmlComponent

Adds a 2D DOM element to the entity, that can move with its transform.

Constructor

new HtmlComponent(domElement, optionsopt)

Parameters:
Name Type Attributes Description
domElement DOMElement
options object <optional>
Properties
Name Type Attributes Default Description
hidden boolean <optional>
false
useTransformComponent boolean <optional>
true
pixelPerfect boolean <optional>
true

Members

domElement

DOM element.

hidden :boolean

isPickable :boolean

Can the entity on which this component resides be picked using this component

pickBounds :BoundingBox

A BoundingBox used for frustum selection of HtmlComponents

pixelPerfect :boolean

Snap to integer pixel positions.

useTransformComponent :boolean

Move with the screen position of the entity.

Methods

getFrustumPickResult(entity, view) → {string}

Default frustum picking behavior for entities with HtmlComponents

Parameters:
Name Type Description
entity

the entity to be picked or not

view

the view containing the frustum to check against