Gondwana Game Engine Development (master) - 2.6.1
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
Loading...
Searching...
No Matches
WidgetDragEventArgs.cs
1using System.Drawing;
2using System.Numerics;
3
4namespace Gondwana.Widgets;
5
10{
21 PointF startScreenPositionPx,
22 PointF currentScreenPositionPx,
24 long tick = 0,
25 int pointerId = 0)
26 : base(widget, tick)
27 {
28 StartScreenPositionPx = startScreenPositionPx;
29 CurrentScreenPositionPx = currentScreenPositionPx;
30 Button = button;
31 PointerId = pointerId;
32 }
33
37 public PointF StartScreenPositionPx { get; }
38
42 public PointF CurrentScreenPositionPx { get; }
43
48
52 public int PointerId { get; }
53
57 public Vector2 TotalDeltaPx => new(CurrentScreenPositionPx.X - StartScreenPositionPx.X,
58 CurrentScreenPositionPx.Y - StartScreenPositionPx.Y);
59}
Provides the base implementation for widgets that can be drawn and receive pointer,...
Definition WidgetBase.cs:12
Vector2 TotalDeltaPx
Gets the total drag offset from the drag start position.
PointF StartScreenPositionPx
Gets the screen position where the drag began.
PointF CurrentScreenPositionPx
Gets the current pointer position in screen pixels.
int PointerId
Gets the identifier of the pointer performing the drag.
WidgetPointerButtonEnum Button
Gets the pointer button used for dragging.
WidgetDragEventArgs(WidgetBase widget, PointF startScreenPositionPx, PointF currentScreenPositionPx, WidgetPointerButtonEnum button=WidgetPointerButtonEnum.Left, long tick=0, int pointerId=0)
Initializes a new instance of the WidgetDragEventArgs class.
WidgetEventArgs(WidgetBase widget, long tick)
Initializes a new instance of the WidgetEventArgs class.
WidgetPointerButtonEnum
Represents a pointer button used by a widget interaction.