HomeWeb Components API Reference - v0.10.1
    Preparing search index...

    Class EntityElement

    The EntityElement interface provides properties and methods for manipulating <pc-entity> elements. The EntityElement interface also inherits the properties and methods of the HTMLElement interface.

    The pointer events below are dispatched by the containing <pc-app> element when the pointer intersects this entity's geometry. They are only generated while the entity has a listener for them, registered either with addEventListener or with the matching inline onpointer* attribute.

    onpointerenter - Script to run when the pointer moves onto the entity.

    onpointerleave - Script to run when the pointer moves off the entity.

    onpointermove - Script to run when the pointer moves over the entity.

    onpointerdown - Script to run when a pointer button is pressed over the entity.

    onpointerup - Script to run when a pointer button is released over the entity.

    pointerenter - Fired when the pointer moves onto the entity.

    pointerleave - Fired when the pointer moves off the entity.

    pointermove - Fired when the pointer moves over the entity.

    pointerdown - Fired when a pointer button is pressed over the entity.

    pointerup - Fired when a pointer button is released over the entity.

    Hierarchy (View Summary)

    Index
    • get enabled(): boolean

      Gets the enabled state of the entity.

      Returns boolean

      Whether the entity is enabled.

    • set enabled(value: boolean): void

      Sets the enabled state of the entity.

      Parameters

      • value: boolean

        Whether the entity is enabled.

      Returns void

    • get entity(): Entity | null

      The PlayCanvas entity instance. null until the element is ready, and again once it has been removed from the document — await whenReady or the element's ready() promise before accessing it.

      Returns Entity | null

      The entity instance, or null.

    • get name(): string

      Gets the name of the entity.

      Returns string

      The name of the entity.

    • set name(value: string): void

      Sets the name of the entity.

      Parameters

      • value: string

        The name of the entity.

      Returns void

    • get position(): Vec3

      Gets the position of the entity.

      Returns Vec3

      The position of the entity.

    • set position(value: Vec3): void

      Sets the position of the entity.

      Parameters

      • value: Vec3

        The position of the entity.

      Returns void

    • get rotation(): Vec3

      Gets the rotation of the entity.

      Returns Vec3

      The rotation of the entity.

    • set rotation(value: Vec3): void

      Sets the rotation of the entity.

      Parameters

      • value: Vec3

        The rotation of the entity.

      Returns void

    • get scale(): Vec3

      Gets the scale of the entity.

      Returns Vec3

      The scale of the entity.

    • set scale(value: Vec3): void

      Sets the scale of the entity.

      Parameters

      • value: Vec3

        The scale of the entity.

      Returns void

    • get tags(): string[]

      Gets the tags of the entity.

      Returns string[]

      The tags of the entity.

    • set tags(value: string[]): void

      Sets the tags of the entity.

      Parameters

      • value: string[]

        The tags of the entity.

      Returns void

    • Called when the element is fully initialized and ready. Subclasses should call this when they're ready. Resolves the ready promise and dispatches a bubbling, composed ready event.

      Returns void