Skip to content

Class ButtonEventArgs

Definition

Namespace: StardewUI.Events
Assembly: StardewUI.dll

Event arguments for an event relating to a button (or key) of some input device.

public class ButtonEventArgs : StardewUI.Events.PointerEventArgs, 
    StardewUI.Layout.IOffsettable<StardewUI.Events.ButtonEventArgs>

Inheritance
ObjectEventArgsBubbleEventArgsPointerEventArgs ⇦ ButtonEventArgs

Implements
IOffsettable<ButtonEventArgs>

Members

Constructors

Name Description
ButtonEventArgs(Vector2, SButton) Event arguments for an event relating to a button (or key) of some input device.

Properties

Name Description
Button The button that triggered the event.
Handled Whether or not the view receiving the event handled the event. Set to true to prevent bubbling.
(Inherited from BubbleEventArgs)
Position The position, relative to the view receiving the event, of the pointer when the event occurred.
(Inherited from PointerEventArgs)

Methods

Name Description
Offset(Vector2) Creates a clone of this instance with an offset applied to its position.

Details

Constructors

ButtonEventArgs(Vector2, SButton)

Event arguments for an event relating to a button (or key) of some input device.

public ButtonEventArgs(Microsoft.Xna.Framework.Vector2 position, StardewModdingAPI.SButton button);
Parameters

position   Vector2
The position of the mouse cursor when the button was pressed.

button   SButton
The button that triggered the event.


Properties

Button

The button that triggered the event.

public StardewModdingAPI.SButton Button { get; }
Property Value

SButton


Methods

Offset(Vector2)

Creates a clone of this instance with an offset applied to its position.

public StardewUI.Events.ButtonEventArgs Offset(Microsoft.Xna.Framework.Vector2 distance);
Parameters

distance   Vector2
The offset distance.

Returns

ButtonEventArgs