Class TCastleTouchNavigation

Unit

Declaration

type TCastleTouchNavigation = class(TCastleUserInterface)

Description

Show draggable controls in the corner, to navigate in the viewport comfortably on touch devices.

Depending on AutoTouchInterface and TouchInterface, we will show 0, 1 or 2 controls to navigate at the bottom, in the left-bottom and right-bottom. It is easiest to just set

MyTouchNavigation.TouchInterface := tiNone; // default
MyTouchNavigation.AutoTouchInterface := ApplicationProperties.TouchDevice;

to activate this automatically on mobile devices, leaving MyTouchNavigation.TouchInterface equal tiNone on non-mobile devices. Alternatively, you can do something like this to control it manually on mobile devices:

MyTouchNavigation.AutoTouchInterface := false; // default
MyTouchNavigation.Exists := ApplicationProperties.TouchDevice;
MyTouchNavigation.TouchInterface := tiSomething;

The size and position of this control determines where the controls appear. Typically this control is added as a direct child of TCastleViewport and has FullSize = True, this way it just fills the TCastleViewport.

The Viewport determines the viewport where navigation is affected by this control. Typically the Viewport is also our visual parent, but it doesn't have to be.

Source: scene/castleviewport_touchnavigation.inc (line 60).

Hierarchy


Generated by PasDoc 0.17.0.snapshot.