InputEventScreenDrag
Represents a screen drag event.
Represents a screen drag event.
Stores information about screen drag events. See Entity._Input.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
InputEventScreenDragConstructor
public InputEventScreenDrag();Properties9
IndexProperty
public int Index { get; set; }The drag event index in the case of a multi-drag event.
PenInvertedProperty
public bool PenInverted { get; set; }Returns true when using the eraser end of a stylus pen.
PositionProperty
public Vector2 Position { get; set; }The drag position in the viewport the node is in, using the coordinate system of this viewport.
PressureProperty
public float Pressure { get; set; }Represents the pressure the user puts on the pen. Ranges from 0.0 to 1.0.
RelativeProperty
public Vector2 Relative { get; set; }The drag position relative to the previous position (position at the last frame).
Note: InputEventScreenDrag.Relative is automatically scaled according to the content scale factor, which is defined by the project's stretch mode settings. This means touch sensitivity will appear different depending on resolution when using InputEventScreenDrag.Relative in a script that handles touch aiming. To avoid this, use InputEventScreenDrag.ScreenRelative instead.
ScreenRelativeProperty
public Vector2 ScreenRelative { get; set; }The unscaled drag position relative to the previous position in screen coordinates (position at the last frame). This position is not scaled according to the content scale factor or calls to InputEvent.XformedBy. This should be preferred over InputEventScreenDrag.Relative for touch aiming regardless of the project's stretch mode.
ScreenVelocityProperty
public Vector2 ScreenVelocity { get; set; }The unscaled drag velocity in pixels per second in screen coordinates. This velocity is not scaled according to the content scale factor or calls to InputEvent.XformedBy. This should be preferred over InputEventScreenDrag.Velocity for touch aiming regardless of the project's stretch mode.
TiltProperty
public Vector2 Tilt { get; set; }Represents the angles of tilt of the pen. Positive X-coordinate value indicates a tilt to the right. Positive Y-coordinate value indicates a tilt toward the user. Ranges from -1.0 to 1.0 for both axes.
VelocityProperty
public Vector2 Velocity { get; set; }The drag velocity.
Note: InputEventScreenDrag.Velocity is automatically scaled according to the content scale factor, which is defined by the project's stretch mode settings. This means touch sensitivity will appear different depending on resolution when using InputEventScreenDrag.Velocity in a script that handles touch aiming. To avoid this, use InputEventScreenDrag.ScreenVelocity instead.
Methods18
GetIndexint
public int GetIndex();intGetPenInvertedbool
public bool GetPenInverted();boolGetPositionVector2
public Vector2 GetPosition();Vector2GetPressurefloat
public float GetPressure();floatGetRelativeVector2
public Vector2 GetRelative();Vector2GetScreenRelativeVector2
public Vector2 GetScreenRelative();Vector2GetScreenVelocityVector2
public Vector2 GetScreenVelocity();Vector2GetTiltVector2
public Vector2 GetTilt();Vector2GetVelocityVector2
public Vector2 GetVelocity();Vector2SetIndexvoid
public void SetIndex(int index);| Name | Type | Default |
|---|---|---|
index | int | — |
SetPenInvertedvoid
public void SetPenInverted(bool penInverted);| Name | Type | Default |
|---|---|---|
penInverted | bool | — |
SetPositionvoid
public void SetPosition(Vector2 position);| Name | Type | Default |
|---|---|---|
position | Vector2 | — |
SetPressurevoid
public void SetPressure(float pressure);| Name | Type | Default |
|---|---|---|
pressure | float | — |
SetRelativevoid
public void SetRelative(Vector2 relative);| Name | Type | Default |
|---|---|---|
relative | Vector2 | — |
SetScreenRelativevoid
public void SetScreenRelative(Vector2 relative);| Name | Type | Default |
|---|---|---|
relative | Vector2 | — |
SetScreenVelocityvoid
public void SetScreenVelocity(Vector2 velocity);| Name | Type | Default |
|---|---|---|
velocity | Vector2 | — |
SetTiltvoid
public void SetTilt(Vector2 tilt);| Name | Type | Default |
|---|---|---|
tilt | Vector2 | — |
SetVelocityvoid
public void SetVelocity(Vector2 velocity);| Name | Type | Default |
|---|---|---|
velocity | Vector2 | — |