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.
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleComponent
- TCastleUserInterface
- TCastleTouchNavigation
Overview
Fields
nested const DefaultAutoWalkTouchInterface = tiWalk; |
|
nested const DefaultAutoExamineTouchInterface = tiPan; |
Methods
constructor Create(AOwner: TComponent); override; |
|
procedure Update(const SecondsPassed: Single; var HandleInput: Boolean); override; |
|
function PropertySections(const PropertyName: String): TPropertySections; override; |
Properties
property Viewport: TCastleViewport read FViewport write SetViewport; |
|
property TouchInterface: TTouchInterface
read FTouchInterface write SetTouchInterface stored TouchInterfaceStored
default tiNone; |
|
property AutoTouchInterface: boolean
read FAutoTouchInterface write SetAutoTouchInterface
default false; |
|
property AutoWalkTouchInterface: TTouchInterface
read FAutoWalkTouchInterface write SetAutoWalkTouchInterface
default DefaultAutoWalkTouchInterface; |
|
property AutoExamineTouchInterface: TTouchInterface
read FAutoExamineTouchInterface write SetAutoExamineTouchInterface
default DefaultAutoExamineTouchInterface; |
|
property ControlMouseDragMode: Boolean
read FControlMouseDragMode write SetControlMouseDragMode default false; |
|
property Scale: Single read FScale write SetScale default 1.0; |
Description
Fields
nested const DefaultAutoWalkTouchInterface = tiWalk; |
|
nested const DefaultAutoExamineTouchInterface = tiPan; |
|
Methods
constructor Create(AOwner: TComponent); override; |
|
procedure Update(const SecondsPassed: Single; var HandleInput: Boolean); override; |
|
function PropertySections(const PropertyName: String): TPropertySections; override; |
|
Properties
property Viewport: TCastleViewport read FViewport write SetViewport; |
|
You must set this property to something non-nil, otherwise this UI control doesn't do much, it will not affect anything. |
property TouchInterface: TTouchInterface
read FTouchInterface write SetTouchInterface stored TouchInterfaceStored
default tiNone; |
|
Configure controls to be visible and available to navigate. This automatically manages under the hood 0, 1 or 2 controls to navigate, placing them at suitable positions and handling their operations. Note that you can set AutoTouchInterface = When ControlMouseDragMode then this property additionally controls the TCastleWalkNavigation.MouseDragMode. |
property AutoTouchInterface: boolean
read FAutoTouchInterface write SetAutoTouchInterface
default false; |
|
Automatically adjust TouchInterface (showing / hiding proper touch controls) based on the detected current Viewport navigation type. |
property AutoWalkTouchInterface: TTouchInterface
read FAutoWalkTouchInterface write SetAutoWalkTouchInterface
default DefaultAutoWalkTouchInterface; |
|
When using AutoTouchInterface = |
property AutoExamineTouchInterface: TTouchInterface
read FAutoExamineTouchInterface write SetAutoExamineTouchInterface
default DefaultAutoExamineTouchInterface; |
|
When using AutoTouchInterface = |
property ControlMouseDragMode: Boolean
read FControlMouseDragMode write SetControlMouseDragMode default false; |
|
Control also TCastleWalkNavigation.MouseDragMode by the AutoTouchInterface and TouchInterface setting. We advise to not use this property, and instead set TCastleWalkNavigation.MouseDragMode manually and explicitly. Otherwise this automatic control may be confusing, as it overrides what you set in editor as TCastleWalkNavigation.MouseDragMode value. |
property Scale: Single read FScale write SetScale default 1.0; |
|
Visual scale of the device. |
Generated by PasDoc 0.16.0.