Class PointerHitbox
Pointer hitbox class
Inheritance
Namespace: Terminaux.Inputs.Pointer
Assembly: Terminaux.dll
Syntax
public class PointerHitbox
Constructors
| Edit this page View SourcePointerHitbox(Coordinate, Action<PointerEventContext>?)
Makes a new instance of the pointer hitbox
Declaration
public PointerHitbox(Coordinate point, Action<PointerEventContext>? callback)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | point | Pointer hitbox to process at this point |
Action<PointerEventContext> | callback | Callback function to run when a mouse event around it is processed |
PointerHitbox(Coordinate, Func<PointerEventContext, object?>?)
Makes a new instance of the pointer hitbox
Declaration
public PointerHitbox(Coordinate point, Func<PointerEventContext, object?>? callback)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | point | Pointer hitbox to process at this point |
Func<PointerEventContext, object> | callback | Callback function to run when a mouse event around it is processed |
PointerHitbox(Coordinate, Coordinate, Action<PointerEventContext>?)
Makes a new instance of the pointer hitbox
Declaration
public PointerHitbox(Coordinate start, Coordinate end, Action<PointerEventContext>? callback)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | start | Starting position of the pointer hitbox |
Coordinate | end | Ending position of the pointer hitbox |
Action<PointerEventContext> | callback | Callback function to run when a mouse event around it is processed |
PointerHitbox(Coordinate, Coordinate, Func<PointerEventContext, object?>?)
Makes a new instance of the pointer hitbox
Declaration
public PointerHitbox(Coordinate start, Coordinate end, Func<PointerEventContext, object?>? callback)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | start | Starting position of the pointer hitbox |
Coordinate | end | Ending position of the pointer hitbox |
Func<PointerEventContext, object> | callback | Callback function to run when a mouse event around it is processed |
PointerHitbox(Coordinate, Size, Action<PointerEventContext>?)
Makes a new instance of the pointer hitbox
Declaration
public PointerHitbox(Coordinate start, Size size, Action<PointerEventContext>? callback)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | start | Starting position of the pointer hitbox |
Size | size | Size of the pointer hitbox |
Action<PointerEventContext> | callback | Callback function to run when a mouse event around it is processed |
PointerHitbox(Coordinate, Size, Func<PointerEventContext, object?>?)
Makes a new instance of the pointer hitbox
Declaration
public PointerHitbox(Coordinate start, Size size, Func<PointerEventContext, object?>? callback)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | start | Starting position of the pointer hitbox |
Size | size | Size of the pointer hitbox |
Func<PointerEventContext, object> | callback | Callback function to run when a mouse event around it is processed |
Properties
| Edit this page View SourceButton
Gets the button or the scrolling direction
Declaration
public PointerButton Button { get; set; }
Property Value
Type | Description |
---|---|
PointerButton |
ButtonPress
Gets the button press state
Declaration
public PointerButtonPress ButtonPress { get; set; }
Property Value
Type | Description |
---|---|
PointerButtonPress |
ClickTier
Specifies whether this is a single-click (1), double-click (2), or more. Only populated in the Released event, and you'll need to populate it when listening to this event via the hitbox instance if ProcessTier is on.
Declaration
public int ClickTier { get; set; }
Property Value
Type | Description |
---|---|
int |
Dragging
Whether the pointer is being dragged or not
Declaration
public bool Dragging { get; set; }
Property Value
Type | Description |
---|---|
bool |
End
Gets the position of where the mouse hitbox ends (usually lower right corner of a rectangle)
Declaration
public Coordinate End { get; }
Property Value
Type | Description |
---|---|
Coordinate |
Modifiers
Gets the modifiers pressed at the time of the event
Declaration
public PointerModifiers Modifiers { get; set; }
Property Value
Type | Description |
---|---|
PointerModifiers |
ProcessTier
Whether to process the click tier or not
Declaration
public bool ProcessTier { get; set; }
Property Value
Type | Description |
---|---|
bool |
Size
Gets the size of the hitbox
Declaration
public Size Size { get; }
Property Value
Type | Description |
---|---|
Size |
Start
Gets the position of where the mouse hitbox starts (usually upper left corner of a rectangle)
Declaration
public Coordinate Start { get; }
Property Value
Type | Description |
---|---|
Coordinate |
Methods
| Edit this page View SourceIsPointerModifierMatch(PointerEventContext)
Checks to see whether the pointer matches the modifier conditions specified
Declaration
public bool IsPointerModifierMatch(PointerEventContext context)
Parameters
Type | Name | Description |
---|---|---|
PointerEventContext | context | Pointer event context to use in comparison |
Returns
Type | Description |
---|---|
bool | True if the pointer meets all modifier conditions; otherwise, false. |
IsPointerWithin(PointerEventContext)
Checks to see whether the pointer is within this hitbox
Declaration
public bool IsPointerWithin(PointerEventContext context)
Parameters
Type | Name | Description |
---|---|---|
PointerEventContext | context | Pointer event context to use in comparison |
Returns
Type | Description |
---|---|
bool | True if the pointer is within the hitbox; otherwise, false. |
ProcessPointer(PointerEventContext, out bool)
Processes the pointer with a callback function
Declaration
public object? ProcessPointer(PointerEventContext context, out bool status)
Parameters
Type | Name | Description |
---|---|---|
PointerEventContext | context | Pointer event context to use when processing the pointer |
bool | status | True if the pointer is within the hitbox and meets all modifier conditions; otherwise, false. |
Returns
Type | Description |
---|---|
object | null if |