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

    Class ButtonComponentElement

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

    Hierarchy (View Summary)

    Index

    Accessors

    • get component(): ButtonComponent | null

      Gets the underlying PlayCanvas button component.

      Returns ButtonComponent | null

      The button component.

    • get enabled(): boolean

      Gets the enabled state of the component.

      Returns boolean

      The enabled state of the component.

    • set enabled(value: boolean): void

      Sets the enabled state of the component.

      Parameters

      • value: boolean

        The enabled state of the component.

      Returns void

    • get fadeDuration(): number

      Gets the duration over which tint transitions are applied.

      Returns number

      The fade duration.

    • set fadeDuration(value: number): void

      Sets the duration (in milliseconds) over which tint transitions are applied.

      Parameters

      • value: number

        The fade duration.

      Returns void

    • get hoverSpriteAsset(): string

      Gets the id of the pc-asset sprite shown when the button is hovered.

      Returns string

      The hover sprite asset id.

    • set hoverSpriteAsset(value: string): void

      Sets the id of the pc-asset sprite shown when the button is hovered (sprite transition mode).

      Parameters

      • value: string

        The hover sprite asset id.

      Returns void

    • get image(): string

      Gets the reference to the <pc-entity> whose image element is used for visual transitions.

      Returns string

      The image entity reference.

    • set image(value: string): void

      Sets the reference (CSS selector, element id or entity name) to the <pc-entity> whose image element is used for visual transitions. Defaults to the button's own entity.

      Parameters

      • value: string

        The image entity reference.

      Returns void

    • get inactiveSpriteAsset(): string

      Gets the id of the pc-asset sprite shown when the button is inactive.

      Returns string

      The inactive sprite asset id.

    • set inactiveSpriteAsset(value: string): void

      Sets the id of the pc-asset sprite shown when the button is inactive (sprite transition mode).

      Parameters

      • value: string

        The inactive sprite asset id.

      Returns void

    • get pressedSpriteAsset(): string

      Gets the id of the pc-asset sprite shown when the button is pressed.

      Returns string

      The pressed sprite asset id.

    • set pressedSpriteAsset(value: string): void

      Sets the id of the pc-asset sprite shown when the button is pressed (sprite transition mode).

      Parameters

      • value: string

        The pressed sprite asset id.

      Returns void

    • get transitionMode(): number

      Gets how the button reacts to being hovered/pressed.

      Returns number

      The transition mode.

    • set transitionMode(value: number): void

      Sets how the button reacts to being hovered/pressed. Can be tint (0) or sprite (1).

      Parameters

      • value: number

        The transition mode.

      Returns void

    Methods