Struct HudDragGesture
One move gesture dragged across the preview, expressed in screen pixels so the editor layer has nothing to convert before calling into HudDragPlacement.
Inherited Members
Namespace: Serenity.GameUi.Application.Placement
Assembly: Serenity.GameUi.Application.dll
Syntax
public readonly struct HudDragGesture
Remarks
IMGUI reports mouse movement with +Y down; the HUD's reference space has +Y up like everything else in the aggregate, so the sign flip lives in HudDragPlacement, not in every caller.
Constructors
HudDragGesture(float, float, float, float, float, float, bool)
Creates a move gesture.
Declaration
public HudDragGesture(float screenDeltaX, float screenDeltaY, float referenceUnitsPerScreenPixel, float referenceWidth, float referenceHeight, float snapStep, bool locksToDominantAxis)
Parameters
| Type | Name | Description |
|---|---|---|
| float | screenDeltaX | Horizontal mouse movement this frame, in screen pixels. |
| float | screenDeltaY | Vertical mouse movement this frame, in screen pixels; positive is down. |
| float | referenceUnitsPerScreenPixel | Reference units one screen pixel covers at the current zoom. |
| float | referenceWidth | The HUD's reference resolution width, in reference units. |
| float | referenceHeight | The HUD's reference resolution height, in reference units. |
| float | snapStep | Grid step the result is rounded to. Zero or less means free movement. |
| bool | locksToDominantAxis | Whether the drag keeps only its dominant axis. |
Fields
LocksToDominantAxis
Whether the drag keeps only its dominant axis, zeroing the other.
Declaration
public readonly bool LocksToDominantAxis
Field Value
| Type | Description |
|---|---|
| bool |
ReferenceHeight
The HUD's reference resolution height, in reference units.
Declaration
public readonly float ReferenceHeight
Field Value
| Type | Description |
|---|---|
| float |
ReferenceUnitsPerScreenPixel
How many reference-resolution units one screen pixel covers at the preview's current zoom.
Declaration
public readonly float ReferenceUnitsPerScreenPixel
Field Value
| Type | Description |
|---|---|
| float |
ReferenceWidth
The HUD's reference resolution width, in reference units.
Declaration
public readonly float ReferenceWidth
Field Value
| Type | Description |
|---|---|
| float |
ScreenDeltaX
Horizontal mouse movement this frame, in screen pixels.
Declaration
public readonly float ScreenDeltaX
Field Value
| Type | Description |
|---|---|
| float |
ScreenDeltaY
Vertical mouse movement this frame, in screen pixels; positive is down.
Declaration
public readonly float ScreenDeltaY
Field Value
| Type | Description |
|---|---|
| float |
SnapStep
Grid step the result is rounded to, in reference units. Zero or less means free movement.
Declaration
public readonly float SnapStep
Field Value
| Type | Description |
|---|---|
| float |