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

options PageCurlOptions

Properties

Snapshot

public PageTurnSnapshot Snapshot { get; }

Property Value

PageTurnSnapshot

Methods

BeginDrag(Vector2, Vector2)

public bool BeginDrag(Vector2 pointer, Vector2 pageSize)

Parameters

pointer Vector2
pageSize Vector2

Returns

bool

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

pointer Vector2
pageSize Vector2
lockedAnchor PageAnchor

Returns

bool

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

pointer Vector2
pageSize Vector2
lockedEdge PageEdge

Returns

bool

BeginProgrammaticTurn(Vector2, PageTurnDirection, bool)

Starts a full page turn without requiring pointer input.

public bool BeginProgrammaticTurn(Vector2 pageSize, PageTurnDirection direction, bool animate = true)

Parameters

pageSize Vector2
direction PageTurnDirection
animate bool

Returns

bool

Cancel(bool)

public void Cancel(bool animate = true)

Parameters

animate bool

EndDrag(bool)

public void EndDrag(bool animate = true)

Parameters

animate bool

GetCurlPose(Vector2)

public CurlPose GetCurlPose(Vector2 pageSize)

Parameters

pageSize Vector2

Returns

CurlPose

Tick(double)

Advances the settle animation. Returns true while it needs frames.

public bool Tick(double elapsedSeconds)

Parameters

elapsedSeconds double

Returns

bool

UpdateDrag(Vector2, double)

public void UpdateDrag(Vector2 pointer, double timestampSeconds = 0)

Parameters

pointer Vector2
timestampSeconds double

Events

PageChangeThresholdCrossed

public event EventHandler<PageChangeThresholdCrossedEventArgs>? PageChangeThresholdCrossed

Event Type

EventHandler<PageChangeThresholdCrossedEventArgs>

PageTurnCompleted

public event EventHandler<PageTurnCompletedEventArgs>? PageTurnCompleted

Event Type

EventHandler<PageTurnCompletedEventArgs>