Class ClickEventArgs
Definition
Namespace: StardewUI.Events
Assembly: StardewUI.dll
Event arguments for a controller or mouse click.
public class ClickEventArgs : StardewUI.Events.PointerEventArgs,
StardewUI.Layout.IOffsettable<StardewUI.Events.ClickEventArgs>
Inheritance
Object ⇦ EventArgs ⇦ BubbleEventArgs ⇦ PointerEventArgs ⇦ ClickEventArgs
Implements
IOffsettable<ClickEventArgs>
Members
Constructors
| Name | Description |
|---|---|
| ClickEventArgs(Vector2, SButton) | Event arguments for a controller or mouse click. |
Properties
| Name | Description |
|---|---|
| Button | The specific button that triggered the click. |
| 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 |
|---|---|
| IsPrimaryButton() | Gets whether the pressed Button is the default for primary actions. |
| IsSecondaryButton() | Gets whether the pressed Button is the default for secondary (context) actions. |
| Offset(Vector2) | Creates a clone of this instance with an offset applied to its position. |
Details
Constructors
ClickEventArgs(Vector2, SButton)
Event arguments for a controller or mouse click.
Parameters
position Vector2
button SButton
The specific button that triggered the click.
Properties
Button
The specific button that triggered the click.
Property Value
SButton
Methods
IsPrimaryButton()
Gets whether the pressed Button is the default for primary actions.
Returns
true if the pressed Button is either MouseLeft or the configured gamepad action button; otherwise, false.
IsSecondaryButton()
Gets whether the pressed Button is the default for secondary (context) actions.
Returns
true if the pressed Button is either MouseRight or the configured gamepad tool-use button; otherwise, false.
Offset(Vector2)
Creates a clone of this instance with an offset applied to its position.
Parameters
distance Vector2
The offset distance.