Class PageTurnController
- Namespace
- PageCurl.Core
- Assembly
- PageCurl.Core.dll
Tracks a finger drag and settles it to the nearest page endpoint using a critically damped spring. It has no UI or platform dependencies.
public sealed class PageTurnController
- Inheritance
-
PageTurnController
- Inherited Members
Constructors
PageTurnController(PageCurlOptions?)
public PageTurnController(PageCurlOptions? options = null)
Parameters
optionsPageCurlOptions
Properties
Snapshot
public PageTurnSnapshot Snapshot { get; }
Property Value
Methods
BeginDrag(Vector2, Vector2)
public bool BeginDrag(Vector2 pointer, Vector2 pageSize)
Parameters
Returns
BeginDrag(Vector2, Vector2, PageAnchor)
Begins a drag with either a stationary edge or a pinned corner. Auto selects an edge from the gesture start.
public bool BeginDrag(Vector2 pointer, Vector2 pageSize, PageAnchor lockedAnchor)
Parameters
pointerVector2pageSizeVector2lockedAnchorPageAnchor
Returns
BeginDrag(Vector2, Vector2, PageEdge)
Begins a drag using a physical edge-aware interaction model. The locked edge is the stationary hinge; Auto chooses the nearest free edge and its opposite hinge.
public bool BeginDrag(Vector2 pointer, Vector2 pageSize, PageEdge lockedEdge)
Parameters
Returns
BeginProgrammaticTurn(Vector2, PageTurnDirection, bool)
Starts a full page turn without requiring pointer input.
public bool BeginProgrammaticTurn(Vector2 pageSize, PageTurnDirection direction, bool animate = true)
Parameters
pageSizeVector2directionPageTurnDirectionanimatebool
Returns
Cancel(bool)
public void Cancel(bool animate = true)
Parameters
animatebool
EndDrag(bool)
public void EndDrag(bool animate = true)
Parameters
animatebool
GetCurlPose(Vector2)
public CurlPose GetCurlPose(Vector2 pageSize)
Parameters
pageSizeVector2
Returns
Tick(double)
Advances the settle animation. Returns true while it needs frames.
public bool Tick(double elapsedSeconds)
Parameters
elapsedSecondsdouble
Returns
UpdateDrag(Vector2, double)
public void UpdateDrag(Vector2 pointer, double timestampSeconds = 0)
Parameters
Events
PageChangeThresholdCrossed
public event EventHandler<PageChangeThresholdCrossedEventArgs>? PageChangeThresholdCrossed
Event Type
PageTurnCompleted
public event EventHandler<PageTurnCompletedEventArgs>? PageTurnCompleted