Table of Contents

Class UIButton

Namespace
Axolotl2D.UI
Assembly
Axolotl2D.dll

Provides hover, press, and click interaction for a UI rectangle.

public sealed class UIButton : Component, IDisposable
Inheritance
UIButton
Implements
Inherited Members

Constructors

UIButton(GameObject, Game)

Provides hover, press, and click interaction for a UI rectangle.

public UIButton(GameObject gameObject, Game game)

Parameters

gameObject GameObject
game Game

Properties

Button

public MouseButton Button { get; set; }

Property Value

MouseButton

Interactable

public bool Interactable { get; set; }

Property Value

bool

IsHovered

public bool IsHovered { get; }

Property Value

bool

IsPressed

public bool IsPressed { get; }

Property Value

bool

Methods

OnDisable()

public override void OnDisable()

Start()

public override void Start()

Update(double)

public override void Update(double deltaTime)

Parameters

deltaTime double

Events

Clicked

public event Action? Clicked

Event Type

Action

PointerEntered

public event Action? PointerEntered

Event Type

Action

PointerExited

public event Action? PointerExited

Event Type

Action

PressedChanged

public event Action<bool>? PressedChanged

Event Type

Action<bool>