Interface IDraggableComponent
Adds the ability for an entity to be dragged on the screen with the mouse/touch.
Inherited Members
Namespace: AGS.API
Assembly: AGS.API.dll
Syntax
[RequiredComponent(typeof(ITranslateComponent), true)]
[RequiredComponent(typeof(IDrawableInfoComponent), false)]
[RequiredComponent(typeof(IUIEvents), true)]
public interface IDraggableComponent : IComponent, IDisposable, INotifyPropertyChanged
Properties
| Improve this Doc View SourceDragMaxX
Allows to limit the dragging to a maximum x (as room coordinates after adjusting for the viewport).
Declaration
float? DragMaxX { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Single> | The drag maximum x. |
DragMaxY
Allows to limit the dragging to a maximum y (as room coordinates after adjusting for the viewport).
Declaration
float? DragMaxY { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Single> | The drag maximum y. |
DragMinX
Allows to limit the dragging to a minimum x (as room coordinates after adjusting for the viewport).
Declaration
float? DragMinX { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Single> | The drag minimum x. |
DragMinY
Allows to limit the dragging to a minimum y (as room coordinates after adjusting for the viewport).
Declaration
float? DragMinY { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Single> | The drag minimum y. |
IsCurrentlyDragged
Gets a value indicating whether this entity is currently dragged.
Declaration
bool IsCurrentlyDragged { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IsDragEnabled
Gets or sets a value indicating whether this entity can be dragged now.
Declaration
bool IsDragEnabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
OnDragStart
Declaration
IBlockingEvent<(float dragStartX, float dragStartY)> OnDragStart { get; }
Property Value
Type | Description |
---|---|
IBlockingEvent<System.ValueTuple<System.Single, System.Single>> |
Methods
| Improve this Doc View SourceSimulateMouseDown(MouseButtonEventArgs)
Simulates a mouse down event. This can be useful if you add the draggable component after the mouse was already pressed down.
Declaration
void SimulateMouseDown(MouseButtonEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
MouseButtonEventArgs | args | Arguments. |