class MAGES::Interaction::UI::ButtonBehaviour

Overview

State keeping for a button. More…

class ButtonBehaviour
{
public:
    // properties

    bool ClickedOnSameGameObject;
    bool IsPressed;
    float PressTime;
    bool WasPressedThisFrame;
    bool WasReleasedThisFrame;

    // methods

    void OnEndOfFrame();
};

// direct descendants

class ButtonModel;

Detailed Documentation

State keeping for a button.

Properties

bool ClickedOnSameGameObject

Gets or sets a value indicating whether the button was pressed on the same game object. Used to detect double clicks.

bool IsPressed

Gets or sets a value indicating whether the button is pressed.

float PressTime

Gets the time the button was pressed.

bool WasPressedThisFrame

Gets a value indicating whether the button was pressed this frame.

bool WasReleasedThisFrame

Gets a value indicating whether the button was released this frame.

Methods

void OnEndOfFrame()

Called on end of frame, resets the frame state of the virtual button.