Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ButtonBehavior

Button behavior class containing the target behavior actions.

Hierarchy

Index

Accessors

behaviorType

Methods

_supportsAction

  • _supportsAction(actionName: string): boolean

isClicked

  • isClicked(user?: User): boolean
  • Gets whether the button is being clicked by the given user, or at all if no user id is given.

    Parameters

    • Optional user: User

      The user to check whether they are clicking this button behavior.

    Returns boolean

    True if the user is clicking, false if not. In the case where no user id is given, this returns true if any user is clicking, false if none are.

isHoveredOver

  • isHoveredOver(user?: User): boolean
  • Gets whether the button is being hovered over by the given user, or at all if no user id is given.

    Parameters

    • Optional user: User

      The user to check whether they are hovering over this button behavior.

    Returns boolean

    True if the user is hovering over, false if not. In the case where no user id is given, this returns true if any user is hovering over, false if none are.

isTargeted

  • isTargeted(user?: User): boolean
  • Gets whether the behavior is being targeted by the given user, or at all if no user is given.

    Parameters

    • Optional user: User

      The user to check whether they are targeting this behavior.

    Returns boolean

    True if the user is targeting this behavior, false if not. In the case where no user id is given, this returns true if any user is targeting this behavior, false if none are.

onButton

  • Add a button handler to be called when a complete button click has occured.

    Parameters

    • buttonState: "pressed" | "holding" | "released"

      The button state to fire the handler on.

    • handler: ActionHandler<ButtonEventData>

      The handler to call when the click state is triggered.

    Returns this

    This button behavior.

onClick

onHover

  • Add a hover handler to be called when the given hover state is triggered.

    Parameters

    • hoverState: "enter" | "hovering" | "exit"

      The hover state to fire the handler on.

    • handler: ActionHandler<ButtonEventData>

      The handler to call when the hover state is triggered.

    Returns this

    This button behavior.

onTarget