Class TCastleWalkNavigation
Unit
Declaration
type TCastleWalkNavigation = class(TCastleMouseLookNavigation)
Description
Navigation by walking or flying (classic first-person shooter navigation) in a 3D scene. User can rotate and move camera using various keys, like arrows or AWSD. Mouse dragging and mouse look are also supported.
Source: transform/castlecameras.pas (line 722).
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleComponent
- TCastleUserInterface
- TCastleNavigation
- TCastleMouseLookNavigation
- TCastleWalkNavigation
Overview
Constants
Fields
| Protected | MouseDraggingStarted: Integer; |
| Protected | MouseDraggingStart: TVector2; |
Methods
| Protected | function GetInternalText: String; virtual; |
| Protected | procedure SetInternalText(const Value: String); virtual; |
| Protected | procedure SetName(const Value: TComponentName); override; |
| Protected | procedure TranslateProperties(const TranslatePropertyEvent: TTranslatePropertyEvent); virtual; |
| Public | procedure SetTransient; |
| Public | procedure AddNonVisualComponent(const NonVisualComponent: TComponent); |
| Public | procedure InsertNonVisualComponent(const Index: Integer; const NonVisualComponent: TComponent); |
| Public | procedure RemoveNonVisualComponent(const NonVisualComponent: TComponent); |
| Public | function NonVisualComponentsIndexOf(const NonVisualComponent: TComponent): Integer; |
| Public | function NonVisualComponentsCount: Integer; |
| Public | function NonVisualComponentsEnumerate: TNonVisualComponentsEnumerator; |
| Public | function ValueIsStreamed: Boolean; virtual; |
| Protected | procedure Loaded; override; |
| Protected | function ContainerWidth: Cardinal; virtual; deprecated 'arrange UI using anchors, FullSize and friends; if you really need container size, use "Container.UnscaledWidth" or "Container.PixelsWidth" after checking "Container <> nil"'; |
| Protected | function ContainerHeight: Cardinal; virtual; deprecated 'arrange UI using anchors, FullSize and friends; if you really need container size, use "Container.UnscaledHeight" or "Container.PixelsHeight" after checking "Container <> nil"'; |
| Protected | function ContainerRect: TRectangle; virtual; deprecated 'arrange UI using anchors, FullSize and friends; if you really need container size, use "Container.UnscaledRect" or "Container.PixelsRect" after checking "Container <> nil"'; |
| Protected | function ContainerSizeKnown: boolean; virtual; deprecated 'arrange UI using anchors, FullSize and friends; if you really need container size, use "Container.UnscaledWidth/Height" or "Container.PixelsWidth/Height" after checking "Container <> nil"'; |
| Protected | procedure DoCursorChange; virtual; deprecated 'better override VisibleChange and watch for chCursor in Changes'; |
| Protected | procedure DefineProperties(Filer: TFiler); override; |
| Protected | procedure UIScaleChanged; virtual; |
| Protected | procedure PreferredSize(var PreferredWidth, PreferredHeight: Single); virtual; |
| Protected | procedure BeforeSizing; virtual; |
| Protected | procedure DoInternalMouseEnter; virtual; |
| Protected | procedure DoInternalMouseLeave; virtual; |
| Protected | function Theme: TCastleTheme; |
| Public | procedure CustomSerialization(const SerializationProcess: TSerializationProcess); override; |
| Public | procedure DesignerInfo(const SList: TStrings); override; |
| Public | procedure DesignerWarnings(const SList: TStrings); override; |
| Public | function GetEnumerator: TEnumerator; |
| Public | procedure InternalSetContainer(const Value: TCastleContainer); virtual; |
| Public | function PreviewPress(const Event: TInputPressRelease): boolean; virtual; |
| Public | function PreviewRelease(const Event: TInputPressRelease): boolean; virtual; |
| Public | procedure VisibleChange(const Changes: TCastleUserInterfaceChanges; const ChangeInitiatedByChildren: boolean = false); overload; virtual; |
| Public | procedure Resize; virtual; |
| Public | function ControlsCount: Integer; |
| Public | procedure InsertFront(const NewItem: TCastleUserInterface); overload; |
| Public | procedure InsertFrontIfNotExists(const NewItem: TCastleUserInterface); |
| Public | procedure InsertFront(const NewItems: TCastleUserInterfaceList); overload; |
| Public | procedure InsertBack(const NewItem: TCastleUserInterface); overload; |
| Public | procedure InsertBackIfNotExists(const NewItem: TCastleUserInterface); |
| Public | procedure InsertBack(const NewItems: TCastleUserInterfaceList); overload; |
| Public | procedure InsertControl(const Index: Integer; const NewItem: TCastleUserInterface); |
| Public | procedure RemoveControl(const Item: TCastleUserInterface); |
| Public | function IndexOfControl(const Item: TCastleUserInterface): Integer; |
| Public | procedure ClearControls; |
| Public | procedure MoveToFront; |
| Public | function CapturesEventsAtPosition(const Position: TVector2): boolean; virtual; |
| Public | procedure BeforeRender; virtual; |
| Public | procedure Render; virtual; |
| Public | procedure RenderOverChildren; virtual; |
| Public | function TooltipExists: Boolean; virtual; deprecated 'use TooltipControl to customize tooltip look'; |
| Public | procedure TooltipRender(const TooltipPosition: TVector2); virtual; deprecated 'use TooltipControl to customize tooltip look'; |
| Public | procedure GLContextOpen; virtual; |
| Public | procedure GLContextClose; virtual; |
| Public | procedure SetFocused(const Value: boolean); virtual; |
| Public | function EffectiveRect: TFloatRectangle; |
| Public | function EffectiveWidth: Single; |
| Public | function EffectiveHeight: Single; |
| Public | function EffectiveWidthForChildren: Single; |
| Public | function EffectiveHeightForChildren: Single; |
| Public | function CalculatedWidth: Cardinal; deprecated 'use EffectiveWidth'; |
| Public | function CalculatedHeight: Cardinal; deprecated 'use EffectiveHeight'; |
| Public | function CalculatedRect: TRectangle; deprecated 'use EffectiveRect'; |
| Public | function RenderRect: TFloatRectangle; |
| Public | function RenderRectWithBorder: TFloatRectangle; |
| Public | function ScreenRect: TRectangle; deprecated 'use RenderRect'; |
| Public | function ContainerToLocalPosition(ContainerPosition: TVector2; const ContainerPositionScaled: Boolean = true): TVector2; |
| Public | function LocalToContainerPosition(const LocalPosition: TVector2; const ContainerPositionScaled: Boolean = true): TVector2; |
| Public | function ParentRect: TFloatRectangle; |
| Public | procedure Anchor(const AHorizontalAnchor: THorizontalPosition; const TranslationX: Single = 0); overload; |
| Public | procedure Anchor( const AHorizontalAnchorSelf, AHorizontalAnchorParent: THorizontalPosition; const TranslationX: Single = 0); overload; |
| Public | procedure Anchor(const AVerticalAnchor: TVerticalPosition; const TranslationY: Single = 0); overload; |
| Public | procedure Anchor( const AVerticalAnchorSelf, AVerticalAnchorParent: TVerticalPosition; const TranslationY: Single = 0); overload; |
| Public | procedure AlignHorizontal( const ControlPosition: TPositionRelative = prMiddle; const ContainerPosition: TPositionRelative = prMiddle; const X: Single = 0); deprecated 'use Anchor'; |
| Public | procedure Align( const ControlPosition: THorizontalPosition; const ContainerPosition: THorizontalPosition; const X: Single = 0); overload; deprecated 'use Anchor'; |
| Public | procedure AlignVertical( const ControlPosition: TPositionRelative = prMiddle; const ContainerPosition: TPositionRelative = prMiddle; const Y: Single = 0); deprecated 'use Anchor'; |
| Public | procedure Align( const ControlPosition: TVerticalPosition; const ContainerPosition: TVerticalPosition; const Y: Single = 0); overload; deprecated 'use Anchor'; |
| Public | procedure Center; deprecated 'use Anchor(hpMiddle); Anchor(vpMiddle); to reliably center the control'; |
| Public | function UIScale: Single; virtual; |
| Public | procedure EditorAllowResize(out ResizeWidth, ResizeHeight: Boolean; out Reason: String); virtual; |
| Public | function EffectiveFullSize: Boolean; |
| Protected | function GoodModelBox: TBox3D; |
| Protected | function InternalViewport: TCastleUserInterface; |
| Protected | function Valid: Boolean; |
| Protected | function UsingInput: TNavigationInputs; |
| Protected | procedure Height(const APosition: TVector3; out AIsAbove: Boolean; out AnAboveHeight: Single; out AnAboveGround: PTriangle); |
| Protected | function MoveTo(const LocalProposedNewPos: TVector3; const BecauseOfGravity, CheckClimbHeight: boolean): boolean; |
| Protected | function Move(const MoveVector: TVector3; const BecauseOfGravity, CheckClimbHeight: boolean): boolean; |
| Protected | function Zoom(const Factor: Single): Boolean; virtual; |
| Public | procedure Assign(Source: TPersistent); override; |
| Public | function Camera: TCastleCamera; |
| Public | function Release(const Event: TInputPressRelease): boolean; override; |
| Public | procedure AnimateTo(const OtherCamera: TCastleCamera; const Time: TFloatTime); overload; deprecated 'use Viewport.Camera.AnimateTo'; |
| Public | procedure AnimateTo(const OtherNavigation: TCastleNavigation; const Time: TFloatTime); overload; deprecated 'use AnimateTo with TCastleCamera, not TCastleNavigation'; |
| Public | procedure AnimateTo(const APos, ADir, AUp: TVector3; const Time: TFloatTime); overload; deprecated 'use Viewport.Camera.AnimateTo'; |
| Public | function Animation: boolean; deprecated 'use Viewport.Camera.Animation'; |
| Public | function InternalUsingMouseLook: Boolean; |
| Protected | function ReallyEnableMouseDragging: boolean; override; |
| Protected | procedure ProcessMouseLookDelta(const Delta: TVector2); override; |
| Protected | function MoveAllowed( const OldPos: TVector3; ProposedNewPos: TVector3; out NewPos: TVector3; const BecauseOfGravity, CheckClimbHeight: Boolean): Boolean; override; |
| Public | constructor Create(AOwner: TComponent); override; |
| Public | destructor Destroy; override; |
| Public | function PropertySections(const PropertyName: String): TPropertySections; override; |
| Public | procedure Update(const SecondsPassed: Single; var HandleInput: boolean); override; |
| Public | function AllowSuspendForInput: boolean; override; |
| Public | function Press(const Event: TInputPressRelease): boolean; override; |
| Public | function SensorTranslation(const X, Y, Z, Length: Double; const SecondsPassed: Single): boolean; override; |
| Public | function SensorRotation(const X, Y, Z, Angle: Double; const SecondsPassed: Single): boolean; override; |
| Public | procedure Init(const AInitialPosition, AInitialDirection, AInitialUp: TVector3; const AGravityUp: TVector3; const APreferredHeight: Single; const ARadius: Single); overload; deprecated 'use Viewport.Camera.SetWorldView, and set GravityUp, PreferredHeight, Radius and call CorrectPreferredHeight manually'; |
| Public | procedure Init(const box: TBox3D; const ARadius: Single); overload; deprecated 'use Viewport.Camera.SetWorldView, and set GravityUp, PreferredHeight, Radius and call CorrectPreferredHeight manually'; |
| Public | function DirectionInGravityPlane: TVector3; deprecated 'avoid using it, as it inherently has difficult cases: it is in TCastleCamera local coordinate space, it cannot be correct when Direction is parallel to gravity'; |
| Public | function Motion(const Event: TInputMotion): boolean; override; |
| Public | procedure CancelFalling; |
| Public | function MaxJumpDistance: Single; |
| Public | function RealPreferredHeight: Single; |
| Public | procedure FallOnTheGround; |
| Public | procedure UpPrefer(const AUp: TVector3); deprecated 'use Viewport.Camera.UpPrefer'; |
| Public | procedure CorrectPreferredHeight; |
| Public | procedure UseGameController(const ControllerIndex: Integer = -1); |
Properties
| Public | property NonVisualComponents [const Index: Integer]: TComponent read GetNonVisualComponents; |
| Public | property IsLoading: Boolean read FIsLoading; |
| Public | property OnVisibleChange: TCastleUserInterfaceChangeEvent
read FOnVisibleChange write FOnVisibleChange; |
| Public | property Container: TCastleContainer read FContainer; |
| Public | property OnCursorChange: TNotifyEvent
read FOnCursorChange write FOnCursorChange; deprecated 'use OnVisibleChange (or override VisibleChange) and watch for Changes that include chCursor'; |
| Public | property ExclusiveEvents: boolean
read FExclusiveEvents write FExclusiveEvents default true; deprecated 'do not use this; supporting this property was complicated and had no real benefit; everything now works as if ExclusiveEvents=true, always'; |
| Public | property Controls [const Index: Integer]: TCastleUserInterface read GetControls write SetControls; |
| Public | property GetExists: Boolean read FExists; deprecated 'use Exists'; |
| Public | property GLInitialized: boolean read FGLInitialized default false; |
| Public | property Focused: boolean read FFocused write SetFocused; |
| Public | property Parent: TCastleUserInterface read FParent ; |
| Public | property FloatWidth: Single read FWidth write SetWidth stored false; deprecated 'use Width'; |
| Public | property FloatHeight: Single read FHeight write SetHeight stored false; deprecated 'use Height'; |
| Public | property AnchorDelta: TVector2 read FTranslation write SetTranslation; deprecated 'use Translation'; |
| Public | property Translation: TVector2 read FTranslation write SetTranslation; |
| Public | property KeepInFront: boolean read FKeepInFront write FKeepInFront
default false; |
| Public | property BorderColor: TCastleColor read FBorderColor write SetBorderColor; |
| Public | property HasHorizontalAnchor: boolean
read FHasHorizontalAnchor write FHasHorizontalAnchor stored false; deprecated 'this property does not do anything anymore, anchors are always active'; |
| Public | property HasVerticalAnchor: boolean
read FHasVerticalAnchor write FHasVerticalAnchor stored false; deprecated 'this property does not do anything anymore, anchors are always active'; |
| Public | property HorizontalAnchorDelta: Single
read GetHorizontalAnchorDelta write SetHorizontalAnchorDelta default 0; deprecated 'use Translation.X'; |
| Public | property VerticalAnchorDelta: Single
read GetVerticalAnchorDelta write SetVerticalAnchorDelta default 0; deprecated 'use Translation.Y'; |
| Public | property Visible: Boolean read FVisible; |
| Public | property EnableUIScaling: boolean
read FEnableUIScaling write SetEnableUIScaling default true; |
| Public | property CapturesEvents: boolean read FCapturesEvents write FCapturesEvents
default true; |
| Public | property OnInternalMouseEnter: TUiNotifyEvent
read FOnInternalMouseEnter write FOnInternalMouseEnter; |
| Public | property OnInternalMouseLeave: TUiNotifyEvent
read FOnInternalMouseLeave write FOnInternalMouseLeave; |
| Published | property Cursor: TMouseCursor read FCursor write SetCursor default mcDefault; |
| Published | property OnUpdate: TUiUpdateEvent read FOnUpdate write FOnUpdate; |
| Published | property OnPress: TUiPressReleaseEvent read FOnPress write FOnPress; |
| Published | property OnRelease: TUiPressReleaseEvent read FOnRelease write FOnRelease; |
| Published | property OnMotion: TUiMotionEvent read FOnMotion write FOnMotion; |
| Published | property OnRender: TUiNotifyEvent read FOnRender write FOnRender; |
| Published | property Exists: boolean read FExists write SetExists default true; |
| Published | property Left: Single read FLeft write SetLeft stored false default 0; deprecated 'use Translation.X'; |
| Published | property Bottom: Single read FBottom write SetBottom default 0; deprecated 'use Translation.Y'; |
| Published | property Width: Single read FWidth write SetWidth default DefaultWidth; |
| Published | property Height: Single read FHeight write SetHeight default DefaultHeight; |
| Published | property WidthFraction: Single read FWidthFraction write SetWidthFraction default 0.0; |
| Published | property HeightFraction: Single read FHeightFraction write SetHeightFraction default 0.0; |
| Published | property AutoSizeToChildren: Boolean
read FAutoSizeToChildren write SetAutoSizeToChildren default false; |
| Published | property AutoSizeToChildrenPaddingRight: Single
read FAutoSizeToChildrenPaddingRight
write SetAutoSizeToChildrenPaddingRight default 0; |
| Published | property AutoSizeToChildrenPaddingTop: Single
read FAutoSizeToChildrenPaddingTop
write SetAutoSizeToChildrenPaddingTop default 0; |
| Published | property HorizontalAnchorSelf: THorizontalPosition
read FHorizontalAnchorSelf write SetHorizontalAnchorSelf default hpLeft; |
| Published | property HorizontalAnchorParent: THorizontalPosition
read FHorizontalAnchorParent write SetHorizontalAnchorParent default hpLeft; |
| Published | property VerticalAnchorSelf: TVerticalPosition
read FVerticalAnchorSelf write SetVerticalAnchorSelf default vpBottom; |
| Published | property VerticalAnchorParent: TVerticalPosition
read FVerticalAnchorParent write SetVerticalAnchorParent default vpBottom; |
| Published | property Culling: Boolean read FCulling write SetCulling default false; |
| Published | property ClipChildren: Boolean read FClipChildren write SetClipChildren default false; |
| Published | property Border: TBorder read FBorder; |
| Published | property CustomTheme: TCastleTheme read FCustomTheme write SetCustomTheme; |
| Published | property TooltipControl: TCastleUserInterface read FTooltipControl write SetTooltipControl; |
| Published | property BorderColorPersistent: TCastleColorPersistent read FBorderColorPersistent ; |
| Published | property TranslationPersistent: TCastleVector2Persistent read FTranslationPersistent ; |
| Public | property OnMoveAllowed: TMoveAllowedFunc read FOnMoveAllowed write FOnMoveAllowed; |
| Public | property OnFall: TFallNotifyFunc read FOnFall write FOnFall; |
| Public | property IgnoreAllInputs: boolean
read GetIgnoreAllInputs write SetIgnoreAllInputs default false; deprecated; |
| Public | property ModelBox: TBox3D read FModelBox write FModelBox; |
| Public | property Input: TNavigationInputs read FInput write FInput default DefaultInput; |
| Public | property Input_ZoomIn: TInputShortcut read FInput_ZoomIn; |
| Public | property Input_ZoomOut: TInputShortcut read FInput_ZoomOut; |
| Published | property FullSize default true; |
| Published | property EditorSelectOnHover default false; |
| Published | property ZoomEnabled: Boolean read FZoomEnabled write FZoomEnabled default false; |
| Published | property CheckCollisions: Boolean read FCheckCollisions write FCheckCollisions default true; |
| Public | property PreferGravityUpForRotations: boolean
read FPreferGravityUpForRotations write FPreferGravityUpForRotations default true; |
| Public | property PreferGravityUpForMoving: boolean
read FPreferGravityUpForMoving write FPreferGravityUpForMoving default true; |
| Public | property MinAngleFromGravityUp: Single
read FMinAngleFromGravityUp write FMinAngleFromGravityUp
default DefaultMinAngleFromGravityUp; |
| Public | property FallSpeedStart: Single
read FFallSpeedStart write FFallSpeedStart
default DefaultFallSpeedStart; |
| Public | property FallSpeedIncrease: Single
read FFallSpeedIncrease write FFallSpeedIncrease
default DefaultFallSpeedIncrease; |
| Public | property Falling: boolean read FFalling write FFalling; |
| Public | property FallingEffect: boolean
read FFallingEffect write FFallingEffect default true; |
| Public | property IsJumping: boolean read FIsJumping; |
| Public | property IsCrouching: boolean read FIsCrouching; |
| Public | property FallingOnTheGround: boolean read FFallingOnTheGround; |
| Public | property IsOnTheGround: boolean read FIsOnTheGround; |
| Public | property IsWalkingOnTheGround: boolean read FIsWalkingOnTheGround; |
| Public | property IsAbove: boolean read FIsAbove; |
| Public | property AboveHeight: Single read FAboveHeight; |
| Public | property AboveGround: PTriangle read FAboveGround write FAboveGround; |
| Public | property Input_Forward: TInputShortcut read FInput_Forward; |
| Public | property Input_Backward: TInputShortcut read FInput_Backward; |
| Public | property Input_LeftRotate: TInputShortcut read FInput_LeftRotate; |
| Public | property Input_RightRotate: TInputShortcut read FInput_RightRotate; |
| Public | property Input_LeftRot: TInputShortcut read FInput_LeftRotate; deprecated 'use Input_LeftRotate'; |
| Public | property Input_RightRot: TInputShortcut read FInput_RightRotate; deprecated 'use Input_RightRotate'; |
| Public | property Input_LeftStrafe: TInputShortcut read FInput_LeftStrafe; |
| Public | property Input_RightStrafe: TInputShortcut read FInput_RightStrafe; |
| Public | property Input_UpRotate: TInputShortcut read FInput_UpRotate; |
| Public | property Input_DownRotate: TInputShortcut read FInput_DownRotate; |
| Public | property Input_IncreasePreferredHeight: TInputShortcut read FInput_IncreasePreferredHeight; |
| Public | property Input_DecreasePreferredHeight: TInputShortcut read FInput_DecreasePreferredHeight; |
| Public | property Input_GravityUp: TInputShortcut read FInput_GravityUp; |
| Public | property Input_Run: TInputShortcut read FInput_Run; |
| Public | property Input_MoveSpeedInc: TInputShortcut read FInput_MoveSpeedInc; |
| Public | property Input_MoveSpeedDec: TInputShortcut read FInput_MoveSpeedDec; |
| Public | property Input_Jump: TInputShortcut read FInput_Jump; |
| Public | property Input_Crouch: TInputShortcut read FInput_Crouch; |
| Public | property MoveForward: boolean read FMoveForward write FMoveForward; |
| Public | property MoveBackward: boolean read FMoveBackward write FMoveBackward; |
| Public | property RotationHorizontalPivot: Single
read FRotationHorizontalPivot write FRotationHorizontalPivot
default 0; deprecated 'use TCastleThirdPersonNavigation for real 3rd-person navigation'; |
| Published | property MouseLook; |
| Published | property MouseLookHorizontalSensitivity; |
| Published | property MouseLookVerticalSensitivity; |
| Published | property InvertVerticalMouseLook; |
| Published | property Radius; |
| Published | property RotationHorizontalSpeed: Single
read FRotationHorizontalSpeed write FRotationHorizontalSpeed
default DefaultRotationHorizontalSpeed; |
| Published | property RotationVerticalSpeed: Single
read FRotationVerticalSpeed write FRotationVerticalSpeed
default DefaultRotationVerticalSpeed; |
| Published | property MoveHorizontalSpeed: Single
read FMoveHorizontalSpeed write FMoveHorizontalSpeed default 1.0; |
| Published | property MoveVerticalSpeed: Single
read FMoveVerticalSpeed write FMoveVerticalSpeed default 1.0; |
| Published | property MoveSpeed: Single read FMoveSpeed write FMoveSpeed default 1.0; |
| Published | property MoveSpeedMin: Single read FMoveSpeedMin write FMoveSpeedMin default DefaultMoveSpeedMin; |
| Published | property MoveSpeedMax: Single read FMoveSpeedMax write FMoveSpeedMax default DefaultMoveSpeedMax; |
| Published | property MouseDraggingHorizontalRotationSpeed: Single
read FMouseDraggingHorizontalRotationSpeed write FMouseDraggingHorizontalRotationSpeed
default DefaultMouseDraggingHorizontalRotationSpeed; |
| Published | property MouseDraggingVerticalRotationSpeed: Single
read FMouseDraggingVerticalRotationSpeed write FMouseDraggingVerticalRotationSpeed
default DefaultMouseDraggingVerticalRotationSpeed; |
| Published | property MouseDraggingMoveSpeed: Single
read FMouseDraggingMoveSpeed write FMouseDraggingMoveSpeed
default DefaultMouseDraggingMoveSpeed; |
| Published | property MouseDragMode: TMouseDragMode
read FMouseDragMode write FMouseDragMode default mdWalkRotate; |
| Published | property Gravity: boolean
read FGravity write FGravity default true; |
| Published | property PreferredHeight: Single
read FPreferredHeight write FPreferredHeight default DefaultPreferredHeight; |
| Published | property CrouchHeight: Single
read FCrouchHeight write FCrouchHeight default DefaultCrouchHeight; |
| Published | property GrowSpeed: Single
read FGrowSpeed write FGrowSpeed
default DefaultGrowSpeed; |
| Published | property JumpMaxHeight: Single
read FJumpMaxHeight write FJumpMaxHeight
default DefaultJumpMaxHeight; |
| Published | property JumpHorizontalSpeedMultiply: Single
read FJumpHorizontalSpeedMultiply write FJumpHorizontalSpeedMultiply
default DefaultJumpHorizontalSpeedMultiply; |
| Published | property JumpTime: Single read FJumpTime write FJumpTime
default DefaultJumpTime; |
| Published | property RunMultiplier: Single read FRunMultiplier write FRunMultiplier
default DefaultRunMultiplier; |
| Published | property AllowSlowerRotations: boolean
read FAllowSlowerRotations write FAllowSlowerRotations
default true; |
| Published | property CheckModsDown: boolean
read FCheckModsDown write FCheckModsDown
default true; |
| Published | property HeadBobbing: Single
read FHeadBobbing write FHeadBobbing default DefaultHeadBobbing; |
| Published | property HeadBobbingTime: Single
read FHeadBobbingTime write FHeadBobbingTime
default DefaultHeadBobbingTime; |
| Published | property ClimbHeight: Single read FClimbHeight write FClimbHeight; |
Description
Constants
| Public | DefaultWidth = 100.0; |
|
This item is declared in ancestor TCastleUserInterface. This item has no description. | |
| Public | DefaultHeight = 100.0; |
|
This item is declared in ancestor TCastleUserInterface. This item has no description. | |
| Public | DefaultRadius = 0.25; |
|
This item is declared in ancestor TCastleNavigation. Default value for TCastleNavigation.Radius. Matches the default VRML/X3D NavigationInfo.avatarSize[0]. | |
| Public | DefaultPreferredHeight = 1.6; |
|
This item is declared in ancestor TCastleNavigation. Default value for TCastleNavigation.PreferredHeight. Matches the default VRML/X3D NavigationInfo.avatarSize[1]. | |
| Public | DefaultInput = [niNormal, niMouseDragging, ni3dMouse, niGesture]; |
|
This item is declared in ancestor TCastleNavigation. This item has no description. | |
| Public | DefaultHeadBobbingTime = 0.5; |
|
This item is declared in ancestor TCastleNavigation. This item has no description. | |
| Public | DefaultHeadBobbing = 0.02; |
|
This item is declared in ancestor TCastleNavigation. This item has no description. | |
| Public | DefaultCrouchHeight = 0.5; |
|
This item is declared in ancestor TCastleNavigation. This item has no description. | |
| Public | DefaultMouseLookHorizontalSensitivity = Pi * 0.1 / 180; |
|
This item is declared in ancestor TCastleMouseLookNavigation. This item has no description. | |
| Public | DefaultMouseLookVerticalSensitivity = Pi * 0.1 / 180; |
|
This item is declared in ancestor TCastleMouseLookNavigation. This item has no description. | |
| Public | DefaultFallSpeedStart = 0.5; |
|
This item has no description. | |
| Public | DefaultGrowSpeed = 1.0; |
|
This item has no description. | |
| Public | DefaultJumpMaxHeight = 1.0; |
|
This item has no description. | |
| Public | DefaultMinAngleFromGravityUp = Pi * 10 / 180; |
|
This item has no description. | |
| Public | DefaultRotationHorizontalSpeed = Pi * 150 / 180; |
|
This item has no description. | |
| Public | DefaultRotationVerticalSpeed = Pi * 100 / 180; |
|
This item has no description. | |
| Public | DefaultFallSpeedIncrease = 13/12; |
|
This item has no description. | |
| Public | DefaultJumpHorizontalSpeedMultiply = 2.0; |
|
This item has no description. | |
| Public | DefaultJumpTime = 1.0 / 8.0; |
|
This item has no description. | |
| Public | DefaultMouseDraggingHorizontalRotationSpeed = Pi * 0.1 / 180; |
|
This item has no description. | |
| Public | DefaultMouseDraggingVerticalRotationSpeed = Pi * 0.1 / 180; |
|
This item has no description. | |
| Public | DefaultMouseDraggingMoveSpeed = 0.01; |
|
This item has no description. | |
| Public | DefaultMoveSpeedMin = 0.01; |
|
This item has no description. | |
| Public | DefaultMoveSpeedMax = 10000.0; |
|
This item has no description. | |
| Public | DefaultRunMultiplier = 2.0; |
|
This item has no description. | |
Fields
| Protected | MouseDraggingStarted: Integer; |
|
This item is declared in ancestor TCastleNavigation.
Needed for niMouseDragging navigation. Checking | |
| Protected | MouseDraggingStart: TVector2; |
|
This item is declared in ancestor TCastleNavigation. This item has no description. | |
Methods
| Protected | function GetInternalText: String; virtual; |
|
This item is declared in ancestor TCastleComponent. This item has no description. | |
| Protected | procedure SetInternalText(const Value: String); virtual; |
|
This item is declared in ancestor TCastleComponent. This item has no description. | |
| Protected | procedure SetName(const Value: TComponentName); override; |
|
This item is declared in ancestor TCastleComponent. This item has no description. | |
| Protected | procedure TranslateProperties(const TranslatePropertyEvent: TTranslatePropertyEvent); virtual; |
|
This item is declared in ancestor TCastleComponent. Enumerate all properties that are possible to translate in this component. E.g. in TCastleLabel it will return TCastleLabel.Caption, in TCastleEdit it will return TCastleEdit.Text and TCastleEdit.Placeholder. Returns only non-empty properties, thus assuming that if current (by convention, English) text is empty, then there is no point in translating it. Moreover descendants may define boolean properties to exclude particular text from translating, e.g. TCastleLabel.CaptionTranslate, TCastleEdit.TextTranslate, TCastleEdit.PlaceholderTranslate. It is not recursive (it doesn't enumerate children properties). Use global TranslateProperties procedure to call this on a hierarchy of TComponent. You usually don't want to call this method (it is called by other engine routines). But you may find it useful to override this, if you define new component. | |
| Public | procedure SetTransient; |
|
This item is declared in ancestor TCastleComponent. Ignore this component when serializing parent's TCastleUserInterface.Controls list or TCastleTransform.List, and do not show this component in CGE editor. This simply sets csTransient flag in ComponentStyle. This is useful for children that are automatically managed by the parent, and should not be modified by user code. For example, TCastleCheckbox is internally composed from TCastleImageControl and TCastleLabel children, but we don't want to serialize or even show these children to user. Note that if you want to prevent this component from serializing as part of TCastleUserInterface.Controls list or TCastleTransform.List, but you still want it to be visible in CGE editor, then make it a "subcomponent" instead, by Note that both csSubComponent and csTransient only disable the component serialization as part of parent's lists enumerated by CustomSerialization (see internal TCastleUserInterface.SerializeChildrenEnumerate , TCastleTransform.SerializeChildrenEnumerate, TCastleTransform.SerializeBehaviorsEnumerate). If you will make the component published in its own property (which is normal for "subcomponents") then it will be serialized anyway, just as part of it's own property (like TCastleScrollView.ScrollArea). So to really avoid serializing a children component make it csSubComponent and/or csTransient, and do not publish it. | |
| Public | procedure AddNonVisualComponent(const NonVisualComponent: TComponent); |
|
This item is declared in ancestor TCastleComponent. Add non-visual component to this component. This is used to organize non-visual components in a tree hierarchy, in CGE designs and editor.
See also
| |
| Public | procedure InsertNonVisualComponent(const Index: Integer; const NonVisualComponent: TComponent); |
|
This item is declared in ancestor TCastleComponent. Insert non-visual component to this component. This is used to organize non-visual components in a tree hierarchy, in CGE designs and editor.
See also
| |
| Public | procedure RemoveNonVisualComponent(const NonVisualComponent: TComponent); |
|
This item is declared in ancestor TCastleComponent. Removes the component previously added by AddNonVisualComponent. | |
| Public | function NonVisualComponentsIndexOf(const NonVisualComponent: TComponent): Integer; |
|
This item is declared in ancestor TCastleComponent. Index of the previously added non-visual component. Returns -1 if the component was not found. | |
| Public | function NonVisualComponentsCount: Integer; |
|
This item is declared in ancestor TCastleComponent. Count of components added by AddNonVisualComponent.
See also
| |
| Public | function NonVisualComponentsEnumerate: TNonVisualComponentsEnumerator; |
|
This item is declared in ancestor TCastleComponent.
You can enumerate current non-visual components using loop like See also
| |
| Public | function ValueIsStreamed: Boolean; virtual; |
|
This item is declared in ancestor TCastleComponent.
Whether the current value of this object should be written to the stream. This should be This is used by CastleComponentSerialize, which is used in Castle Game Engine for all serialization. In simple cases, this just says whether the current value of this object equals to some default value. The default implementation of this class returns Descendants that override this to sometimes return The name of this method is consistent with TPropertyEditor.ValueIsStreamed in LCL. | |
| Protected | procedure Loaded; override; |
|
This item is declared in ancestor TCastleUserInterface. This item has no description. | |
| Protected | function ContainerWidth: Cardinal; virtual; deprecated 'arrange UI using anchors, FullSize and friends; if you really need container size, use "Container.UnscaledWidth" or "Container.PixelsWidth" after checking "Container <> nil"'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: arrange UI using anchors, FullSize and friends; if you really need container size, use "Container.UnscaledWidth" or "Container.PixelsWidth" after checking "Container <> nil" Container sizes. | |
| Protected | function ContainerHeight: Cardinal; virtual; deprecated 'arrange UI using anchors, FullSize and friends; if you really need container size, use "Container.UnscaledHeight" or "Container.PixelsHeight" after checking "Container <> nil"'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: arrange UI using anchors, FullSize and friends; if you really need container size, use "Container.UnscaledHeight" or "Container.PixelsHeight" after checking "Container <> nil" This item has no description. | |
| Protected | function ContainerRect: TRectangle; virtual; deprecated 'arrange UI using anchors, FullSize and friends; if you really need container size, use "Container.UnscaledRect" or "Container.PixelsRect" after checking "Container <> nil"'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: arrange UI using anchors, FullSize and friends; if you really need container size, use "Container.UnscaledRect" or "Container.PixelsRect" after checking "Container <> nil" This item has no description. | |
| Protected | function ContainerSizeKnown: boolean; virtual; deprecated 'arrange UI using anchors, FullSize and friends; if you really need container size, use "Container.UnscaledWidth/Height" or "Container.PixelsWidth/Height" after checking "Container <> nil"'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: arrange UI using anchors, FullSize and friends; if you really need container size, use "Container.UnscaledWidth/Height" or "Container.PixelsWidth/Height" after checking "Container <> nil" This item has no description. | |
| Protected | procedure DoCursorChange; virtual; deprecated 'better override VisibleChange and watch for chCursor in Changes'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: better override VisibleChange and watch for chCursor in Changes Called when Cursor changed. In TCastleUserInterface class, just calls OnCursorChange. | |
| Protected | procedure DefineProperties(Filer: TFiler); override; |
|
This item is declared in ancestor TCastleUserInterface. This item has no description. | |
| Protected | procedure UIScaleChanged; virtual; |
|
This item is declared in ancestor TCastleUserInterface. This item has no description. | |
| Protected | procedure PreferredSize(var PreferredWidth, PreferredHeight: Single); virtual; |
|
This item is declared in ancestor TCastleUserInterface. Controls that have a preferred size should override this. By default this contains values derived from Width, WidthFraction, Height, HeightFraction, with Border subtracted. Note that the arguments should be already scaled, i.e. multiplied by UIScale, i.e. expressed in final device pixels. Note that the returned PreferredWidth and PreferredHeight must not include the space for Border. Border size will be added later. | |
| Protected | procedure BeforeSizing; virtual; |
|
This item is declared in ancestor TCastleUserInterface. Called right before calculating size. This is your only chance to adjust e.g. children size, if you need them to be synchronized with something, and you may use AutoSizeToChildren. In most use-cases, you rather adjust preferred size by overriding PreferredSize. | |
| Protected | procedure DoInternalMouseEnter; virtual; |
|
This item is declared in ancestor TCastleUserInterface. This item has no description. | |
| Protected | procedure DoInternalMouseLeave; virtual; |
|
This item is declared in ancestor TCastleUserInterface. This item has no description. | |
| Protected | function Theme: TCastleTheme; |
|
This item is declared in ancestor TCastleUserInterface. Theme that should be used by this control. Either CustomTheme or global Theme. | |
| Public | procedure CustomSerialization(const SerializationProcess: TSerializationProcess); override; |
|
This item is declared in ancestor TCastleUserInterface. This item has no description. Showing description inherited from TCastleComponent.CustomSerialization. Override this method to call various methods of SerializationProcess, which in turn allows to serialize/deserialize things that are not published. This allows to serialize/deserialize with more freedom, e.g. to serialize/deserialize some private field. | |
| Public | procedure DesignerInfo(const SList: TStrings); override; |
|
This item is declared in ancestor TCastleUserInterface. This item has no description. Showing description inherited from TCastleComponent.DesignerInfo.
Override to add information that should be visible at design-time. Call | |
| Public | procedure DesignerWarnings(const SList: TStrings); override; |
|
This item is declared in ancestor TCastleUserInterface. This item has no description. Showing description inherited from TCastleComponent.DesignerWarnings.
Override to add warnings that should be visible at design-time. Call | |
| Public | function GetEnumerator: TEnumerator; |
|
This item is declared in ancestor TCastleUserInterface. This item has no description. | |
| Public | procedure InternalSetContainer(const Value: TCastleContainer); virtual; |
|
This item is declared in ancestor TCastleUserInterface. This item has no description. | |
| Public | function PreviewPress(const Event: TInputPressRelease): boolean; virtual; |
|
This item is declared in ancestor TCastleUserInterface. Similar to Press but allows the parent control to preview the event before it is passed to children UI controls. See also
| |
| Public | function PreviewRelease(const Event: TInputPressRelease): boolean; virtual; |
|
This item is declared in ancestor TCastleUserInterface. Similar to Release but allows the parent control to preview the event before it is passed to children UI controls. See also
| |
| Public | procedure VisibleChange(const Changes: TCastleUserInterfaceChanges; const ChangeInitiatedByChildren: boolean = false); overload; virtual; |
|
This item is declared in ancestor TCastleUserInterface. Called always when something important inside this control (or it's children) changed. To be more precise, this is called when something mentioned among the TCastleUserInterfaceChange enumerated items changed. This is always called with Changes <> [] (non-empty set). | |
| Public | procedure Resize; virtual; |
|
This item is declared in ancestor TCastleUserInterface. Event called when the container (component or window with OpenGL context) size changes. You can resize/reposition your component here to react to parent size changes. This is called only when the rendering context of the container is initialized, so you can be sure that this is called only between GLContextOpen and GLContextClose. We also call this once when inserting into the controls list (like TCastleWindow.Controls or TCastleControl.Controls or inside parent TCastleUserInterface), if inserting into the container/parent with already initialized OpenGL context. If inserting into the container/parent without OpenGL context initialized, it will be called later, when OpenGL context will get initialized, right after GLContextOpen. In other words, this is always called to let the control know the size of the container, if and only if the OpenGL context is initialized. | |
| Public | function ControlsCount: Integer; |
|
This item is declared in ancestor TCastleUserInterface. This item has no description. | |
| Public | procedure InsertFront(const NewItem: TCastleUserInterface); overload; |
|
This item is declared in ancestor TCastleUserInterface. Add child control, at the front of other children. | |
| Public | procedure InsertFrontIfNotExists(const NewItem: TCastleUserInterface); |
|
This item is declared in ancestor TCastleUserInterface. This item has no description. | |
| Public | procedure InsertFront(const NewItems: TCastleUserInterfaceList); overload; |
|
This item is declared in ancestor TCastleUserInterface. This item has no description. | |
| Public | procedure InsertBack(const NewItem: TCastleUserInterface); overload; |
|
This item is declared in ancestor TCastleUserInterface. Add child control, at the back of other children. | |
| Public | procedure InsertBackIfNotExists(const NewItem: TCastleUserInterface); |
|
This item is declared in ancestor TCastleUserInterface. This item has no description. | |
| Public | procedure InsertBack(const NewItems: TCastleUserInterfaceList); overload; |
|
This item is declared in ancestor TCastleUserInterface. This item has no description. | |
| Public | procedure InsertControl(const Index: Integer; const NewItem: TCastleUserInterface); |
|
This item is declared in ancestor TCastleUserInterface. Add child control at specified position. It is usually easier to use InsertFront or InsertBack, if possible. | |
| Public | procedure RemoveControl(const Item: TCastleUserInterface); |
|
This item is declared in ancestor TCastleUserInterface. Remove control added by InsertFront or InsertBack. Note that this method does not free the Item instance. This method merely removes Item from our controls, so that Item is no longer rendered as part of this parent. It is still the caller's responsibility to make sure the Item is freed at some point. See https://castle-engine.io/modern_pascal#_freeing_classes for description how to free instances in Pascal. As TCastleUserInterface descends from TComponent, a simple and proper solution is often just to create it with some "owner" (like TCastleView.FreeAtStop or Application) that will take care of freeing it. | |
| Public | function IndexOfControl(const Item: TCastleUserInterface): Integer; |
|
This item is declared in ancestor TCastleUserInterface. Index of child control, or -1 if not present. | |
| Public | procedure ClearControls; |
|
This item is declared in ancestor TCastleUserInterface. Remove all child controls added by InsertFront or InsertBack. Note that, just like RemoveControl, this method does not free the children controls. This method merely removes children controls, so they are no longer rendered as part of the parent. It is still the caller's responsibility to make sure the children controls are freed at some point. See https://castle-engine.io/modern_pascal#_freeing_classes for description how to free instances in Pascal. As TCastleUserInterface descends from TComponent, a simple and proper solution is often just to create it with some "owner" (like TCastleView.FreeAtStop or Application) that will take care of freeing it. | |
| Public | procedure MoveToFront; |
|
This item is declared in ancestor TCastleUserInterface. Move to become the front-most control within the parent. This works when this control is a child of another control (has Parent assigned) or when it's a direct child of the container (in which case Parent is not assigned by Container is, which means the control is directly on TCastleContainer.Controls list). This is ignored if this control is not within any container (so, also not within any parent). | |
| Public | function CapturesEventsAtPosition(const Position: TVector2): boolean; virtual; |
|
This item is declared in ancestor TCastleUserInterface.
Does this control capture events under this container position. The default implementation simply checks whether Position is inside RenderRect. It also checks whether CapturesEvents is Always treated like | |
| Public | procedure BeforeRender; virtual; |
|
This item is declared in ancestor TCastleUserInterface. Prepare your resources, right before drawing. Called only when Exists and GLInitialized. Do not explicitly call this method. Instead, render controls by adding them to the TCastleContainer.Controls list, or render them explicitly (for off-screen rendering) by TCastleContainer.RenderControl. | |
| Public | procedure Render; virtual; |
|
This item is declared in ancestor TCastleUserInterface. Render a control. Called only when Exists and render context is initialized. Do not call this method. It will be automatically called by the engine when needed. It will be called when UI is part of TCastleContainer.Controls list or rendered (e.g. for off-screen rendering) by TCastleContainer.RenderControl. You should only override this method. See https://castle-engine.io/manual_2d_ui_custom_drawn.php for examples what you can put here. You can depend on some OpenGL state being set before calling this method. You can depend on it being set, and you can carelessly change it. This state we set:
Beware that GLSL RenderContext.CurrentProgram has undefined value when this is called. You should always set it, before making direct OpenGL drawing calls (all the engine drawing routines do it already, this is only a concern if you make direct OpenGL / OpenGLES calls). | |
| Public | procedure RenderOverChildren; virtual; |
|
This item is declared in ancestor TCastleUserInterface. Render a control contents over the children controls. This is analogous to Render, but it executes after children are drawn. You should usually prefer to override Render instead of this method, as the convention is that the parent is underneath children. You should only override this method (do not call it, it will be called by the engine). See https://castle-engine.io/manual_2d_ui_custom_drawn.php for examples what you can put here. | |
| Public | function TooltipExists: Boolean; virtual; deprecated 'use TooltipControl to customize tooltip look'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: use TooltipControl to customize tooltip look
Render a tooltip of this control. If you want to have tooltip for this control detected, you have to override TooltipRender is called in the same way as Render. TooltipRender is always called as a last (front-most) control. Argument TooltipPosition is the left-bottom (in screen space, regardless of UIScaling) suggested position of the tooltip. It is simplest to descend from TCastleUserInterfaceFont, that implements simple TCastleUserInterfaceFont.Tooltip property and overrides these two methods as necessary. | |
| Public | procedure TooltipRender(const TooltipPosition: TVector2); virtual; deprecated 'use TooltipControl to customize tooltip look'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: use TooltipControl to customize tooltip look This item has no description. | |
| Public | procedure GLContextOpen; virtual; |
|
This item is declared in ancestor TCastleUserInterface. Initialize your OpenGL resources. This is called when OpenGL context of the container is created, or when the control is added to the already existing context. In other words, this is the moment when you can initialize OpenGL resources, like display lists, VBOs, OpenGL texture names, etc. As an exception, this is called regardless of the Exists value. This way a control can prepare it's resources, regardless if it exists now. | |
| Public | procedure GLContextClose; virtual; |
|
This item is declared in ancestor TCastleUserInterface. Destroy your OpenGL resources. Called when OpenGL context of the container is destroyed. Also called when controls is removed from the container You should release here any resources that are tied to the OpenGL context. In particular, the ones created in GLContextOpen. As an exception, this is called regardless of the Exists value. This way a control can release it's resources, regardless if it exists now. | |
| Public | procedure SetFocused(const Value: boolean); virtual; |
|
This item is declared in ancestor TCastleUserInterface. Called when this control becomes or stops being focused, that is: under the mouse cursor and will receive events. This updates Focused property. This also calls OnInternalMouseEnter / OnInternalMouseLeave. | |
| Public | function EffectiveRect: TFloatRectangle; |
|
This item is declared in ancestor TCastleUserInterface. Control position and size. Use this to base other controls size/position on this control's calculated size/position. The algorithm that determines control position and size is like this:
The above describes the size of the content and border, summed. The content itself may be a little smaller, when the Border is used. The size of the "content itself" is returned only by The anchors (see Anchor) also affect the final position of the control. Note that some descendants do auto-sizing by default. This means that some of these properties may be ignored, and instead the calculated size (EffectiveWidth, EffectiveHeight) depends on some core values of the control. For example:
Consult the documentation of each descendant for the exact specification of the size behavior. This method returns the rectangle in local coordinates (relative to the parent 2D control). The returned rectangle size includes the border size. The returned rectangle size uses "unscaled" coordinates, which means that they correspond to the sizes you set e.g. in TCastleUserInterface.Width, TCastleUserInterface.Height, and translation units you use with e.g. TCastleUserInterface.Anchor. If you're looking for a way to query the size of the control in final scaled coordinates (in real device pixels), and not relative to the parent position, use RenderRect or RenderRectWithBorder instead. This method ignores the current value of the Exists method and Exists property, that is: the result of this function assumes that control does exist.
See also
| |
| Public | function EffectiveWidth: Single; |
|
This item is declared in ancestor TCastleUserInterface. Calculated width of the control, without UI scaling. Useful if you want to base other controls size/position on this control calculated size. Unlike the Width property, this is the effective size, not the desired size. So this is already processed by any auto-sizing mechanism (e.g. TCastleImageControl may adjust it's own size to the underlying image, depending on settings), it is changed by FullSize and so on. It is always equal to just See also
| |
| Public | function EffectiveHeight: Single; |
|
This item is declared in ancestor TCastleUserInterface. Calculated height of the control, without UI scaling. Useful if you want to base other controls size/position on this control calculated size. Unlike the Height property, this is the effective size, not the desired size. So this is already processed by any auto-sizing mechanism (e.g. TCastleImageControl may adjust it's own size to the underlying image, depending on settings), it is changed by FullSize and so on. It is always equal to just See also
| |
| Public | function EffectiveWidthForChildren: Single; |
|
This item is declared in ancestor TCastleUserInterface. EffectiveWidth without Border size. | |
| Public | function EffectiveHeightForChildren: Single; |
|
This item is declared in ancestor TCastleUserInterface. EffectiveHeight without Border size. | |
| Public | function CalculatedWidth: Cardinal; deprecated 'use EffectiveWidth'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: use EffectiveWidth This item has no description. | |
| Public | function CalculatedHeight: Cardinal; deprecated 'use EffectiveHeight'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: use EffectiveHeight This item has no description. | |
| Public | function CalculatedRect: TRectangle; deprecated 'use EffectiveRect'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: use EffectiveRect This item has no description. | |
| Public | function RenderRect: TFloatRectangle; |
|
This item is declared in ancestor TCastleUserInterface. Position and size of this control, assuming it exists, in container coordinates (in final device pixels). The primary use of this is inside Render. A proper UI control should adjust to draw precisely in this rectangle. | |
| Public | function RenderRectWithBorder: TFloatRectangle; |
|
This item is declared in ancestor TCastleUserInterface. This item has no description. | |
| Public | function ScreenRect: TRectangle; deprecated 'use RenderRect'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: use RenderRect This item has no description. | |
| Public | function ContainerToLocalPosition(ContainerPosition: TVector2; const ContainerPositionScaled: Boolean = true): TVector2; |
|
This item is declared in ancestor TCastleUserInterface. Convert position relative to container (in final device coordinates, without UI scaling, by default) into position relative to this UI control (in coordinates with UI scaling). Useful e.g. to convert mouse/touch position from TInputPressRelease.Position into position useful for children of this UI control. The exact definition is that using the result of this to set our child Translation, assuming the child is anchored to the left-bottom (the default state) and child has Left = Bottom = 0, sets child position exactly to the indicated point on the container. Parameters
| |
| Public | function LocalToContainerPosition(const LocalPosition: TVector2; const ContainerPositionScaled: Boolean = true): TVector2; |
|
This item is declared in ancestor TCastleUserInterface. Convert position relative to this UI control (in coordinates with UI scaling) into relative to container (in final device coordinates, without UI scaling, by default). Reverses ContainerToLocalPosition. Parameters
| |
| Public | function ParentRect: TFloatRectangle; |
|
This item is declared in ancestor TCastleUserInterface. Rectangle filling the parent control (or container), in local coordinates. Since this is in local coordinates, the returned rectangle Left and Bottom are always zero, unless parent has Border (the returned rectangle is shrunk by Parent.Border). This is already scaled by UI scaling. | |
| Public | procedure Anchor(const AHorizontalAnchor: THorizontalPosition; const TranslationX: Single = 0); overload; |
|
This item is declared in ancestor TCastleUserInterface. Adjust position to align us with the parent horizontally. The resulting EffectiveRect and RenderRect and RenderRectWithBorder will immediately reflect the new position. Note that position set here (anchors, Translation) are ignored when FullSize is set to true. In case of FullSize, the control fills the parent perfectly. This utility method sets HorizontalAnchorSelf, HorizontalAnchorParent, Translation.X. | |
| Public | procedure Anchor( const AHorizontalAnchorSelf, AHorizontalAnchorParent: THorizontalPosition; const TranslationX: Single = 0); overload; |
|
This item is declared in ancestor TCastleUserInterface. Adjust position to align us with the parent horizontally. The resulting EffectiveRect and RenderRect and RenderRectWithBorder will immediately reflect the new position. Note that position set here (anchors, Translation) are ignored when FullSize is set to true. In case of FullSize, the control fills the parent perfectly. This utility method sets HorizontalAnchorSelf, HorizontalAnchorParent, Translation.X. | |
| Public | procedure Anchor(const AVerticalAnchor: TVerticalPosition; const TranslationY: Single = 0); overload; |
|
This item is declared in ancestor TCastleUserInterface. Adjust position to align us to the parent vertically. The resulting EffectiveRect and RenderRect and RenderRectWithBorder will immediately reflect the new position. Note that position set here (anchors, Translation) are ignored when FullSize is set to true. In case of FullSize, the control fills the parent perfectly. This utility method sets VerticalAnchorSelf, VerticalAnchorParent, Translation.Y. | |
| Public | procedure Anchor( const AVerticalAnchorSelf, AVerticalAnchorParent: TVerticalPosition; const TranslationY: Single = 0); overload; |
|
This item is declared in ancestor TCastleUserInterface. Adjust position to align us to the parent vertically. The resulting EffectiveRect and RenderRect and RenderRectWithBorder will immediately reflect the new position. Note that position set here (anchors, Translation) are ignored when FullSize is set to true. In case of FullSize, the control fills the parent perfectly. This utility method sets VerticalAnchorSelf, VerticalAnchorParent, Translation.Y. | |
| Public | procedure AlignHorizontal( const ControlPosition: TPositionRelative = prMiddle; const ContainerPosition: TPositionRelative = prMiddle; const X: Single = 0); deprecated 'use Anchor'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: use Anchor Immediately position the control with respect to the parent by adjusting Left. Deprecated, use Align with THorizontalPosition. | |
| Public | procedure Align( const ControlPosition: THorizontalPosition; const ContainerPosition: THorizontalPosition; const X: Single = 0); overload; deprecated 'use Anchor'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: use Anchor Immediately position the control with respect to the parent by adjusting Left. Note that using Anchor is often more comfortable than this method, since you only need to set anchor once (for example, right after creating the control). In contrast, adjusting position using this method will typically need to be repeated at each window on resize, like in TCastleUserInterface.Resize. | |
| Public | procedure AlignVertical( const ControlPosition: TPositionRelative = prMiddle; const ContainerPosition: TPositionRelative = prMiddle; const Y: Single = 0); deprecated 'use Anchor'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: use Anchor Immediately position the control with respect to the parent by adjusting Bottom. Deprecated, use Align with TVerticalPosition. | |
| Public | procedure Align( const ControlPosition: TVerticalPosition; const ContainerPosition: TVerticalPosition; const Y: Single = 0); overload; deprecated 'use Anchor'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: use Anchor Immediately position the control with respect to the parent by adjusting Bottom. Note that using Anchor is often more comfortable than this method, since you only need to set anchor once (for example, right after creating the control). In contrast, adjusting position using this method will typically need to be repeated at each window on resize, like in TCastleUserInterface.Resize. | |
| Public | procedure Center; deprecated 'use Anchor(hpMiddle); Anchor(vpMiddle); to reliably center the control'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: use Anchor(hpMiddle); Anchor(vpMiddle); to reliably center the control Immediately center the control within the parent, both horizontally and vertically. Note that using Anchor is often more comfortable than this method, since you only need to set anchor once. For example, right after creating the control call | |
| Public | function UIScale: Single; virtual; |
|
This item is declared in ancestor TCastleUserInterface. UI scale of this control, derived from container (see TCastleContainer.UIScaling and EnableUIScaling). | |
| Public | procedure EditorAllowResize(out ResizeWidth, ResizeHeight: Boolean; out Reason: String); virtual; |
|
This item is declared in ancestor TCastleUserInterface. Override this to prevent resizing some dimension in CGE editor. | |
| Public | function EffectiveFullSize: Boolean; |
|
This item is declared in ancestor TCastleUserInterface. Is the FullSize actually active. Checks FullSize and not AutoSizeToChildren, i.e. it accounts that AutoSizeToChildren overrides FullSize (since they cannot both work at the same time). | |
| Protected | function GoodModelBox: TBox3D; |
|
This item is declared in ancestor TCastleNavigation. Box around which the Examine navigation should work. Note that calling this has sometimes non-trivial cost, needs to iterate over items, so save the result to a variable if you need to use it multiple times. | |
| Protected | function InternalViewport: TCastleUserInterface; |
|
This item is declared in ancestor TCastleNavigation.
Viewport we should manipulate. This is | |
| Protected | function Valid: Boolean; |
|
This item is declared in ancestor TCastleNavigation.
If this is | |
| Protected | function UsingInput: TNavigationInputs; |
|
This item is declared in ancestor TCastleNavigation. Behave as if Input is like this. This allows to disable input when not Valid. | |
| Protected | procedure Height(const APosition: TVector3; out AIsAbove: Boolean; out AnAboveHeight: Single; out AnAboveGround: PTriangle); |
|
This item is declared in ancestor TCastleNavigation. Check collisions to determine how high above ground is given point (in world coordinates). Checks collisions through parent TCastleViewport, if CheckCollisions. | |
| Protected | function MoveTo(const LocalProposedNewPos: TVector3; const BecauseOfGravity, CheckClimbHeight: boolean): boolean; |
|
This item is declared in ancestor TCastleNavigation. Like Move, but you pass here final ProposedNewPos. LocalProposedNewPos is given in TCastleCamera parent coordinates, so it works naturally in the same space as TCastleCamera.Translation, Direction, Up. You can think "I want to move to Translation + MoveVector". | |
| Protected | function Move(const MoveVector: TVector3; const BecauseOfGravity, CheckClimbHeight: boolean): boolean; |
|
This item is declared in ancestor TCastleNavigation.
Try to move from current Translation to Translation + MoveVector. Checks MoveAllowed, also (if CheckClimbHeight is MoveVector is given in TCastleCamera parent coordinates, so it works naturally in the same space as TCastleCamera.Translation, Direction, Up. You can think "I want to move TCastleCamera to Translation + MoveVector". Returns | |
| Protected | function Zoom(const Factor: Single): Boolean; virtual; |
|
This item is declared in ancestor TCastleNavigation. Zoom in / out. Negative Factor makes "zoom out", positive makes "zoom in" (zero makes nothing). Called only if ZoomEnabled, so no need to check it within implementation. Factor values correspond to TInputPressRelease.MouseWheelScroll values, so 1.0 should be treated like a "one operation" and some systems only generate values -1 or +1 (and never fractions). | |
| Public | procedure Assign(Source: TPersistent); override; |
|
This item is declared in ancestor TCastleNavigation. This item has no description. | |
| Public | function Camera: TCastleCamera; |
|
This item is declared in ancestor TCastleNavigation.
Associated TCastleCamera of the viewport. May return Exceptions raised
| |
| Public | function Release(const Event: TInputPressRelease): boolean; override; |
|
This item is declared in ancestor TCastleNavigation. This item has no description. Showing description inherited from TCastleUserInterface.Release.
Override this method to react to user releasing a key, mouse button. Return This is counterpart to Press method. See Press for more details. Note: We'd like this method to also be called when user releases a mouse wheel. But currently releasing of the mouse wheel is not reported now by any backend. Only releasing of keys and mouse buttons is reported. | |
| Public | procedure AnimateTo(const OtherCamera: TCastleCamera; const Time: TFloatTime); overload; deprecated 'use Viewport.Camera.AnimateTo'; |
|
This item is declared in ancestor TCastleNavigation. Warning: this symbol is deprecated: use Viewport.Camera.AnimateTo This item has no description. | |
| Public | procedure AnimateTo(const OtherNavigation: TCastleNavigation; const Time: TFloatTime); overload; deprecated 'use AnimateTo with TCastleCamera, not TCastleNavigation'; |
|
This item is declared in ancestor TCastleNavigation. Warning: this symbol is deprecated: use AnimateTo with TCastleCamera, not TCastleNavigation This item has no description. | |
| Public | procedure AnimateTo(const APos, ADir, AUp: TVector3; const Time: TFloatTime); overload; deprecated 'use Viewport.Camera.AnimateTo'; |
|
This item is declared in ancestor TCastleNavigation. Warning: this symbol is deprecated: use Viewport.Camera.AnimateTo This item has no description. | |
| Public | function Animation: boolean; deprecated 'use Viewport.Camera.Animation'; |
|
This item is declared in ancestor TCastleNavigation. Warning: this symbol is deprecated: use Viewport.Camera.Animation This item has no description. | |
| Public | function InternalUsingMouseLook: Boolean; |
|
This item is declared in ancestor TCastleMouseLookNavigation. This item has no description. | |
| Protected | function ReallyEnableMouseDragging: boolean; override; |
|
This item has no description. Showing description inherited from TCastleNavigation.ReallyEnableMouseDragging. Can we use mouse dragging. Checks UsingInput and so Valid already. | |
| Protected | procedure ProcessMouseLookDelta(const Delta: TVector2); override; |
|
This item has no description. | |
| Protected | function MoveAllowed( const OldPos: TVector3; ProposedNewPos: TVector3; out NewPos: TVector3; const BecauseOfGravity, CheckClimbHeight: Boolean): Boolean; override; |
|
This item has no description. Showing description inherited from TCastleNavigation.MoveAllowed. Check collisions to determine can the object move. Object wants to move from OldPos to ProposedNewPos (in world coordinates). Returns If you're doing a simple check for collisions, you will always want to set NewPos to ProposedNewPos when returning But you can also do more sophisticated calculations and sometimes not allow user to move to ProposedNewPos, but allow him to move instead to some other close position. For example when doing "wall sliding" (common in FPS games): when you're trying to walk "into the wall", you move along the wall instead. It's allowed to modify NewPos when returning BecauseOfGravity says whether this move is caused by gravity dragging the player down. You can use BecauseOfGravity e.g. to implement TCastleViewport.PreventInfiniteFallingDown. Implementation calls OnMoveAllowed and checks collisions through parent TCastleViewport, if CheckCollisions. | |
| Public | constructor Create(AOwner: TComponent); override; |
|
This item has no description. | |
| Public | destructor Destroy; override; |
|
This item has no description. | |
| Public | function PropertySections(const PropertyName: String): TPropertySections; override; |
|
This item has no description. Showing description inherited from TCastleComponent.PropertySections. Section where to show property in the editor. | |
| Public | procedure Update(const SecondsPassed: Single; var HandleInput: boolean); override; |
|
This item has no description. Showing description inherited from TCastleUserInterface.Update. Control may do here anything that must be continuously repeated. E.g. camera handles here falling down due to gravity, rotating model in Examine mode, and many more.
This method may be used, among many other things, to continuously react to the fact that user pressed some key (or mouse button). For example, if holding some key should move some 3D object, you should do something like: if HandleInput then begin if Container.Pressed[keyArrowRight] then begin Transform.Position := Transform.Position + Vector3(SecondsPassed * 10, 0, 0); HandleInput := false; end; end;
Instead of directly using a key code, consider also using TInputShortcut that makes the input key nicely configurable. See engine tutorial about handling inputs. Multiplying movement by SecondsPassed makes your operation frame-rate independent. Object will move by 10 units in a second, regardless of how many FPS your game has. The code related to HandleInput is important if you write a generally-useful control that should nicely cooperate with all other controls, even when placed on top of them or under them. The correct approach is to only look at pressed keys/mouse buttons if HandleInput is Note that to handle a single press / release (like "switch light on when pressing a key") you should rather use Press and Release methods. Use this method only for continuous handling (like "holding this key makes the light brighter and brighter"). To understand why such HandleInput approach is needed, realize that the "Update" events are called differently than simple mouse and key events like "Press" and "Release". "Press" and "Release" events return whether the event was somehow "handled", and the container passes them only to the controls under the mouse (decided by TCastleUserInterface.CapturesEventsAtPosition). And as soon as some control says it "handled" the event, other controls (even if under the mouse) will not receive the event. This approach is not suitable for Update events. Some controls need to do the Update job all the time, regardless of whether the control is under the mouse and regardless of what other controls already did. So all controls (well, all controls that exist, in case of TCastleUserInterface, see TCastleUserInterface.Exists) receive Update calls. So the "handled" status is passed through HandleInput. If a control is not under the mouse, it will receive HandleInput = | |
| Public | function AllowSuspendForInput: boolean; override; |
|
This item has no description. Showing description inherited from TCastleUserInterface.AllowSuspendForInput.
Allow window containing this control to suspend waiting for user input. Typically you want to override this to return In this class, this simply returns always | |
| Public | function Press(const Event: TInputPressRelease): boolean; override; |
|
This item has no description. Showing description inherited from TCastleUserInterface.Press.
Override this method to react to user pressing a key, mouse button or mouse wheel. Return When implementing in descendants it is best to override it like this: function TMyControl.Press(const Event: TInputPressRelease): boolean; begin Result := inherited; if Result then Exit; // exit if ancestor already handled this event if Event.IsKey(keyEnter) then begin // do something in reaction to Enter key ... // let engine know that this input event was handled Exit(true); end; if Event.IsMouseButton(buttonLeft) then begin // do something in reaction to left mouse button press ... // let engine know that this input event was handled Exit(true); end; end;
These events are generated for all UI controls, whether they are considered "interactive" or not. These events are generated for non-interactive controls like TCastleRectangleControl or TCastleLabel as well. For example, these events ignore the TCastleButton.Enabled state, they are generated always (see https://github.com/castle-engine/castle-engine/issues/413 ). Use instead TCastleButton.OnClick to detect clicks on a button in a way that honors the TCastleButton.Enabled state. When a control returns The events Press and Release are passed to the parent only after the children had a chance to process this event. Overriding them makes sense if you draw something that "looks clickable" in TCastleUserInterface.Render, which is the standard place you should draw stuff. For example our TCastleButton draws there. In contrast, the events PreviewPress and PreviewRelease are passed first to the parent control, before children have a chance to process this event. In partcular, overriding them makes sense if you draw something that "looks clickable" in TCastleUserInterface.RenderOverChildren. | |
| Public | function SensorTranslation(const X, Y, Z, Length: Double; const SecondsPassed: Single): boolean; override; |
|
This item has no description. Showing description inherited from TCastleUserInterface.SensorTranslation. Translation detected by 3D sensor. Used for example by 3Dconnexion devices.
| |
| Public | function SensorRotation(const X, Y, Z, Angle: Double; const SecondsPassed: Single): boolean; override; |
|
This item has no description. Showing description inherited from TCastleUserInterface.SensorRotation. Rotation detected by 3D sensor. Used for example by 3Dconnexion devices.
| |
| Public | procedure Init(const AInitialPosition, AInitialDirection, AInitialUp: TVector3; const AGravityUp: TVector3; const APreferredHeight: Single; const ARadius: Single); overload; deprecated 'use Viewport.Camera.SetWorldView, and set GravityUp, PreferredHeight, Radius and call CorrectPreferredHeight manually'; |
|
Warning: this symbol is deprecated: use Viewport.Camera.SetWorldView, and set GravityUp, PreferredHeight, Radius and call CorrectPreferredHeight manually Set the most important properties of this navigation, in one call. Sets camera properties (Translation, Direction, Up). Given here AInitialDirection, AInitialUp, AGravityUp will be normalized, and AInitialUp will be adjusted to be orthogonal to AInitialDirection (see Camera.SetWorldView). Sets also PreferredHeight and Radius. PreferredHeight may be adjusted to be sensible (by calling CorrectPreferredHeight(ARadius)). You can pass ARadius = 0.0 if you really don't want this PreferredHeight adjustment. | |
| Public | procedure Init(const box: TBox3D; const ARadius: Single); overload; deprecated 'use Viewport.Camera.SetWorldView, and set GravityUp, PreferredHeight, Radius and call CorrectPreferredHeight manually'; |
|
Warning: this symbol is deprecated: use Viewport.Camera.SetWorldView, and set GravityUp, PreferredHeight, Radius and call CorrectPreferredHeight manually Alternative Init that sets camera properties such that an object inside Box is more or less "visible good". Sets InitialCameraXxx properties to make it look right, sets current CameraXxx properties to InitialCameraXxx. Sets GravityUp to the same thing as InitialUp. Sets also PreferredHeight to make it behave "sensibly". | |
| Public | function DirectionInGravityPlane: TVector3; deprecated 'avoid using it, as it inherently has difficult cases: it is in TCastleCamera local coordinate space, it cannot be correct when Direction is parallel to gravity'; |
|
Warning: this symbol is deprecated: avoid using it, as it inherently has difficult cases: it is in TCastleCamera local coordinate space, it cannot be correct when Direction is parallel to gravity This item has no description. | |
| Public | function Motion(const Event: TInputMotion): boolean; override; |
|
This item has no description. Showing description inherited from TCastleUserInterface.Motion. Motion of mouse or touch. | |
| Public | procedure CancelFalling; |
|
If Falling, then this will force Falling to false without calling OnFallenDown. It's much like forcing the opinion that "camera is not falling down right now". Note that if we will find out (e.g. in nearest Update) that camera is still too high above the ground, then we will start falling down again, setting Falling back to true. (but then we will start falling down from the beginning with initial falling down speed). This is useful to call if you just changed Camera.Translation because e.g. the player teleported somewhere (or e.g. game levels changed). In this case you just want to forget the fact that camera was falling down — no consequences (like lowering player's health, fadeout etc.). | |
| Public | function MaxJumpDistance: Single; |
|
Returns just JumpMaxHeight * PreferredHeight, see JumpMaxHeight for explanation. | |
| Public | function RealPreferredHeight: Single; |
|
The PreferredHeight slightly modified by head bobbing and crouch. It can be useful for collision detection between camera and something. | |
| Public | procedure FallOnTheGround; |
|
This makes a visual effect of camera falling down horizontally on the ground. Nice to use when player died, and you want to show that it's body falled on the ground. This works by gradually changing Camera.Up such that it gets orthogonal to GravityUp. | |
| Public | procedure UpPrefer(const AUp: TVector3); deprecated 'use Viewport.Camera.UpPrefer'; |
|
Warning: this symbol is deprecated: use Viewport.Camera.UpPrefer Change up vector, keeping the direction unchanged. If necessary, the up vector provided here will be fixed to be orthogonal to direction. See TCastleTransform.UpPrefer for detailed documentation what this does. | |
| Public | procedure CorrectPreferredHeight; |
|
Correct PreferredHeight based on Radius and on current HeadBobbing. Exactly what and why is done: if you do any kind of collision detection with some Radius, then you should make sure that RealPreferredHeight is always >= of your Radius, otherwise strange effects may happen when crouching or when head bobbing forces camera to go down. Exactly, the required equation is MinimumRealPreferredHeight := PreferredHeight * CrouchHeight * (1 - HeadBobbing);
and always must be MinimumRealPreferredHeight >= RealPreferredHeight
Reasoning: otherwise this class would "want camera to fall down" (because we will always be higher than RealPreferredHeight) but your OnMoveAllowed would not allow it (because Radius would not allow it). This method will make sure that this condition holds by eventually adjusting (making larger) PreferredHeight. Note that for Radius = 0.0 this will always leave PreferredHeight as it is. | |
| Public | procedure UseGameController(const ControllerIndex: Integer = -1); |
|
Accept game controller (joystick, gamepad) events to control this navigation. This enhances TInputShortcut.Bindings of some inputs, to react to game controller events. The layout follows typical game controller layout for 3D games:
Note: Calling this many times on the same navigation is not recommended, as we don't clear previous bindings. If you need to adjust the bindings, we recommend you just look at the simple implementation of this method, copy it to your code, and adjust to your needs. Parameters
| |
Properties
| Public | property NonVisualComponents [const Index: Integer]: TComponent read GetNonVisualComponents; |
|
This item is declared in ancestor TCastleComponent. Components added by AddNonVisualComponent. | |
| Public | property IsLoading: Boolean read FIsLoading; |
|
This item is declared in ancestor TCastleComponent. Is the component during deserialization now. Note: We can't use | |
| Public | property OnVisibleChange: TCastleUserInterfaceChangeEvent
read FOnVisibleChange write FOnVisibleChange; |
|
This item is declared in ancestor TCastleUserInterface. Called always when something important inside this control (or it's children) changed. See VisibleChange for details about when and how this is called. Be careful when handling this event. Various changes may cause this, so be prepared to handle it at any moment, even in the middle when UI control is changing. It may also occur very often. It's usually safest to only set a boolean flag like "something should be recalculated" when this event happens, and do the actual recalculation later. | |
| Public | property Container: TCastleContainer read FContainer; |
|
This item is declared in ancestor TCastleUserInterface.
Container of this control. When adding control to container's Controls list (like TCastleWindow.Controls) container will automatically set itself here, and when removing from container this will be changed back to May be | |
| Public | property OnCursorChange: TNotifyEvent
read FOnCursorChange write FOnCursorChange; deprecated 'use OnVisibleChange (or override VisibleChange) and watch for Changes that include chCursor'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: use OnVisibleChange (or override VisibleChange) and watch for Changes that include chCursor Event called when the Cursor property changes. This event is, in normal circumstances, used by the Container, so you should not use it in your own programs. | |
| Public | property ExclusiveEvents: boolean
read FExclusiveEvents write FExclusiveEvents default true; deprecated 'do not use this; supporting this property was complicated and had no real benefit; everything now works as if ExclusiveEvents=true, always'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: do not use this; supporting this property was complicated and had no real benefit; everything now works as if ExclusiveEvents=true, always
Should we disable further mouse / keys handling for events that we already handled in this control. If This means that events will not be simultaneously handled by both this control and some other (or camera or normal window callbacks), which is usually more sensible, but sometimes somewhat limiting. | |
| Public | property Controls [const Index: Integer]: TCastleUserInterface read GetControls write SetControls; |
|
This item is declared in ancestor TCastleUserInterface. This item has no description. | |
| Public | property GetExists: Boolean read FExists; deprecated 'use Exists'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: use Exists This item has no description. | |
| Public | property GLInitialized: boolean read FGLInitialized default false; |
|
This item is declared in ancestor TCastleUserInterface. This item has no description. | |
| Public | property Focused: boolean read FFocused write SetFocused; |
|
This item is declared in ancestor TCastleUserInterface. See SetFocused. | |
| Public | property Parent: TCastleUserInterface read FParent ; |
|
This item is declared in ancestor TCastleUserInterface.
Visual parent control. This control is rendered within the parent, and it's anchors and coordinates are relative to the parent. Parent may be Note that this property doesn't have a setter, as it could be confusing: the order in which children are inserted into parent sometimes matters, for back-and-front order. If you want to change the parent, you can use code like this: if Control.Parent <> nil then Control.Parent.RemoveControl(Control); if NewParent <> nil then NewParent.InsertFront(Control); // or InsertBack, as InsertControl... | |
| Public | property FloatWidth: Single read FWidth write SetWidth stored false; deprecated 'use Width'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: use Width This item has no description. | |
| Public | property FloatHeight: Single read FHeight write SetHeight stored false; deprecated 'use Height'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: use Height This item has no description. | |
| Public | property AnchorDelta: TVector2 read FTranslation write SetTranslation; deprecated 'use Translation'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: use Translation Position of the control, relative to the anchor at parent (by default, relative to left-bottom corner of the parent). | |
| Public | property Translation: TVector2 read FTranslation write SetTranslation; |
|
This item is declared in ancestor TCastleUserInterface. Position of the control, relative to the anchor at parent (by default, relative to left-bottom corner of the parent). | |
| Public | property KeepInFront: boolean read FKeepInFront write FKeepInFront
default false; |
|
This item is declared in ancestor TCastleUserInterface.
Keep the control in front of other controls (with TODO: Do not change this property while the control is already a child of something. | |
| Public | property BorderColor: TCastleColor read FBorderColor write SetBorderColor; |
|
This item is declared in ancestor TCastleUserInterface. Color of the Border, by default completely transparent black. | |
| Public | property HasHorizontalAnchor: boolean
read FHasHorizontalAnchor write FHasHorizontalAnchor stored false; deprecated 'this property does not do anything anymore, anchors are always active'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: this property does not do anything anymore, anchors are always active This item has no description. | |
| Public | property HasVerticalAnchor: boolean
read FHasVerticalAnchor write FHasVerticalAnchor stored false; deprecated 'this property does not do anything anymore, anchors are always active'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: this property does not do anything anymore, anchors are always active This item has no description. | |
| Public | property HorizontalAnchorDelta: Single
read GetHorizontalAnchorDelta write SetHorizontalAnchorDelta default 0; deprecated 'use Translation.X'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: use Translation.X Delta between our border and parent. See also
| |
| Public | property VerticalAnchorDelta: Single
read GetVerticalAnchorDelta write SetVerticalAnchorDelta default 0; deprecated 'use Translation.Y'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: use Translation.Y Delta between our border and parent. See also
| |
| Public | property Visible: Boolean read FVisible; |
|
This item is declared in ancestor TCastleUserInterface.
Is the control possibly visible. This is always | |
| Public | property EnableUIScaling: boolean
read FEnableUIScaling write SetEnableUIScaling default true; |
|
This item is declared in ancestor TCastleUserInterface.
Enable or disable UI scaling for this particular control. See more about UI scaling on TCastleContainer.UIScaling and TCastleUserInterface.UIScale. Setting this to Note that this does not work recursively, i.e. it does not affect the children of this control. Setting this to The use-cases for changing this property to "false" are very rare. Usually you should use UI scaling for 100% of your UI. | |
| Public | property CapturesEvents: boolean read FCapturesEvents write FCapturesEvents
default true; |
|
This item is declared in ancestor TCastleUserInterface.
Capture input events (keyboard, mouse, joystick). If The only exception is when this control is set as TCastleContainer.ForceCaptureInput. In this case, the control will receive inputs. In other words, TCastleContainer.ForceCaptureInput overrides the intent of this property. This property may be replaced by something like "CaptureInput" or just universal "Enabled" in the future. | |
| Public | property OnInternalMouseEnter: TUiNotifyEvent
read FOnInternalMouseEnter write FOnInternalMouseEnter; |
|
This item is declared in ancestor TCastleUserInterface.
Called when control starts being under the mouse cursor and will receive events. See SetFocused, this is called when Focused changes from This is called "Internal" now, because we do not guarantee it's 100% always paired with OnInternalMouseLeave. A different approach to this may be done in the future releases. | |
| Public | property OnInternalMouseLeave: TUiNotifyEvent
read FOnInternalMouseLeave write FOnInternalMouseLeave; |
|
This item is declared in ancestor TCastleUserInterface.
Called when control stops being under the mouse cursor and will receive events. See SetFocused, this is called when Focused changes from This is called "Internal" now, because we do not guarantee it's 100% always paired with OnInternalMouseEnter. A different approach to this may be done in the future releases. | |
| Published | property Cursor: TMouseCursor read FCursor write SetCursor default mcDefault; |
|
This item is declared in ancestor TCastleUserInterface. Mouse cursor over this control. When user moves mouse over the Container, the currently focused (topmost under the cursor) control determines the mouse cursor look. | |
| Published | property OnUpdate: TUiUpdateEvent read FOnUpdate write FOnUpdate; |
|
This item is declared in ancestor TCastleUserInterface. Event that occurs continuously on each control. See Update for details. | |
| Published | property OnPress: TUiPressReleaseEvent read FOnPress write FOnPress; |
|
This item is declared in ancestor TCastleUserInterface. An input (key, mouse button, mouse wheel) was pressed. See Press for details. | |
| Published | property OnRelease: TUiPressReleaseEvent read FOnRelease write FOnRelease; |
|
This item is declared in ancestor TCastleUserInterface. An input (key, mouse button, mouse wheel) was released. See Release for details. | |
| Published | property OnMotion: TUiMotionEvent read FOnMotion write FOnMotion; |
|
This item is declared in ancestor TCastleUserInterface. Pointer (mouse or finger) moved. See Motion for details. | |
| Published | property OnRender: TUiNotifyEvent read FOnRender write FOnRender; |
|
This item is declared in ancestor TCastleUserInterface. Control is being displayed. See Render for details. This event it called after the Render method of this control finished but before we started rendering children. | |
| Published | property Exists: boolean read FExists write SetExists default true; |
|
This item is declared in ancestor TCastleUserInterface. Not existing control is not visible, it doesn't receive input and generally doesn't exist from the point of view of user. This is mostly equivalent to just removing this control from parent list. Non-existing controls still receive GLContextOpen, GLContextClose, Resize events. | |
| Published | property Left: Single read FLeft write SetLeft stored false default 0; deprecated 'use Translation.X'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: use Translation.X Position from the left side of the parent control. It's usually better to use anchors instead of this property. For example, instead of setting Note that the effects of this property and Translation.X are summed, if you set both. We advise to leave Left as zero and just use anchors in new code. | |
| Published | property Bottom: Single read FBottom write SetBottom default 0; deprecated 'use Translation.Y'; |
|
This item is declared in ancestor TCastleUserInterface. Warning: this symbol is deprecated: use Translation.Y Position from the bottom side of the parent control. It's usually better to use anchors instead of this property. For example, instead of setting Note that the effects of this property and Translation.Y are summed, if you set both. We advise to leave Bottom as zero and just use anchors in new code. | |
| Published | property Width: Single read FWidth write SetWidth default DefaultWidth; |
|
This item is declared in ancestor TCastleUserInterface. These properties determine the control size. See the EffectiveRect documentation for details how the size is calculated.
See also
| |
| Published | property Height: Single read FHeight write SetHeight default DefaultHeight; |
|
This item is declared in ancestor TCastleUserInterface. This item has no description. | |
| Published | property WidthFraction: Single read FWidthFraction write SetWidthFraction default 0.0; |
|
This item is declared in ancestor TCastleUserInterface. This item has no description. | |
| Published | property HeightFraction: Single read FHeightFraction write SetHeightFraction default 0.0; |
|
This item is declared in ancestor TCastleUserInterface. This item has no description. | |
| Published | property AutoSizeToChildren: Boolean
read FAutoSizeToChildren write SetAutoSizeToChildren default false; |
|
This item is declared in ancestor TCastleUserInterface. Adjust size to encompass all the children. The properties FullSize, Width, Height are ignored in this case. Our Left and Bottom still matter. Our size is adjusted to all existing children sizes and positions. We add AutoSizeToChildrenPaddingTop to the resulting height, and AutoSizeToChildrenPaddingRight to the resulting width. | |
| Published | property AutoSizeToChildrenPaddingRight: Single
read FAutoSizeToChildrenPaddingRight
write SetAutoSizeToChildrenPaddingRight default 0; |
|
This item is declared in ancestor TCastleUserInterface. Padding added when AutoSizeToChildren is used. TODO: Should be AutoSizeToChildrenPaddingHorizontal, there's nothing that makes it specific to "right" or "left" side now. | |
| Published | property AutoSizeToChildrenPaddingTop: Single
read FAutoSizeToChildrenPaddingTop
write SetAutoSizeToChildrenPaddingTop default 0; |
|
This item is declared in ancestor TCastleUserInterface. Padding added when AutoSizeToChildren is used. TODO: Should be AutoSizeToChildrenPaddingVertical, there's nothing that makes it specific to "top" or "bottom" side now. | |
| Published | property HorizontalAnchorSelf: THorizontalPosition
read FHorizontalAnchorSelf write SetHorizontalAnchorSelf default hpLeft; |
|
This item is declared in ancestor TCastleUserInterface. Which our border to align with parent. See also
| |
| Published | property HorizontalAnchorParent: THorizontalPosition
read FHorizontalAnchorParent write SetHorizontalAnchorParent default hpLeft; |
|
This item is declared in ancestor TCastleUserInterface. Which parent border is aligned to our HorizontalAnchorSelf border. See also
| |
| Published | property VerticalAnchorSelf: TVerticalPosition
read FVerticalAnchorSelf write SetVerticalAnchorSelf default vpBottom; |
|
This item is declared in ancestor TCastleUserInterface. Which our border to align with parent. See also
| |
| Published | property VerticalAnchorParent: TVerticalPosition
read FVerticalAnchorParent write SetVerticalAnchorParent default vpBottom; |
|
This item is declared in ancestor TCastleUserInterface. Which parent border is aligned to our VerticalAnchorSelf border. See also
| |
| Published | property Culling: Boolean read FCulling write SetCulling default false; |
|
This item is declared in ancestor TCastleUserInterface. Optimize rendering and event processing by checking whether the control can be visible. The visibility is checked by looking at container rectangle, and all possible clipping parents (set by TCastleScrollView, or any other control with ClipChildren). This is useful for UI controls that have expensive rendering or other events (e.g. they do something non-trivial in Render or RenderOverChildren, or they include a lot of children controls). And they may be placed off-screen, or they may be outside of a parent with clipping, which is often the case when the parent is TCastleScrollView. | |
| Published | property ClipChildren: Boolean read FClipChildren write SetClipChildren default false; |
|
This item is declared in ancestor TCastleUserInterface. Clip the rendering of children. By default this is When this property is | |
| Published | property Border: TBorder read FBorder; |
|
This item is declared in ancestor TCastleUserInterface. Border (by default transparent) of the control. Border adds a space from the control content (drawn within RenderRect) to the control rectangle (returned by RenderRectWithBorder) (scaled), or EffectiveRect (unscaled) and friends). It is transparent by default, but you can change it by BorderColor. Border works always, regardless of FullSize or AutoSizeToChildren. One obvious use-case is to use this for visual space (empty space or a colorful frame, separating this control from the rest). Another use-case is to reserve a predictable space for as additional (sibling) control within the same parent. E.g. you can set FullSize=true and Border.Top=100, and this way there is always a strip with Height=100 at the top of the parent, where you can insert another control (with Height=100, anchored to the top). | |
| Published | property CustomTheme: TCastleTheme read FCustomTheme write SetCustomTheme; |
|
This item is declared in ancestor TCastleUserInterface. Use a custom instance of TCastleTheme to determine the look of this control. | |
| Published | property TooltipControl: TCastleUserInterface read FTooltipControl write SetTooltipControl; |
|
This item is declared in ancestor TCastleUserInterface.
If set, the indicated control will act as a tooltip: we will make it existing when we should show the tooltip for this control, we will make it no longer existing when the tooltip for this should be hidden. Initially the If The visual parent of | |
| Published | property BorderColorPersistent: TCastleColorPersistent read FBorderColorPersistent ; |
|
This item is declared in ancestor TCastleUserInterface. BorderColor that can be visually edited in Castle Game Engine Editor, Lazarus and Delphi. Normal user code does not need to deal with this, instead read or write BorderColor directly. See also
Source: ui/auto_generated_persistent_vectors/tcastleuserinterface_persistent_vectors.inc (line 37). | |
| Published | property TranslationPersistent: TCastleVector2Persistent read FTranslationPersistent ; |
|
This item is declared in ancestor TCastleUserInterface. Translation that can be visually edited in Castle Game Engine Editor, Lazarus and Delphi. Normal user code does not need to deal with this, instead read or write Translation directly. See also
Source: ui/auto_generated_persistent_vectors/tcastleuserinterface_persistent_vectors.inc (line 105). | |
| Public | property OnMoveAllowed: TMoveAllowedFunc read FOnMoveAllowed write FOnMoveAllowed; |
|
This item is declared in ancestor TCastleNavigation. Used by MoveAllowed, see there for description. You can assign this property. | |
| Public | property OnFall: TFallNotifyFunc read FOnFall write FOnFall; |
|
This item is declared in ancestor TCastleNavigation. Notification that we have been falling down for some time due to gravity, and suddenly stopped (which means we "hit the ground"). This event can be useful in games, for example to lower player's health, and/or make a visual effect (like a "red out" indicating pain) and/or make a sound effect ("Ouch!" or "Thud!" or such sounds). You can look at FallHeight parameter, given to the callback, e.g. to gauge how much health decreases. | |
| Public | property IgnoreAllInputs: boolean
read GetIgnoreAllInputs write SetIgnoreAllInputs default false; deprecated; |
|
This item is declared in ancestor TCastleNavigation. Warning: this symbol is deprecated.
Deprecated, use more flexible Input instead. | |
| Public | property ModelBox: TBox3D read FModelBox write FModelBox; |
|
This item is declared in ancestor TCastleNavigation. Approximate size of the world that is viewed. Determines the speed of zooming and (in case of TCastleExamineNavigation) of many other operations too. Initially this is an empty box. Internally we will use the Viewport.Items.BoundingBox if this is empty. | |
| Public | property Input: TNavigationInputs read FInput write FInput default DefaultInput; |
|
This item is declared in ancestor TCastleNavigation. Input methods available to user. See documentation of TNavigationInput type for possible values and their meaning. To disable any user interaction with this navigation you can simply set this to empty. | |
| Public | property Input_ZoomIn: TInputShortcut read FInput_ZoomIn; |
|
This item is declared in ancestor TCastleNavigation. Bring camera closer to the model. Works only if ZoomEnabled. By deafult mwUp (mouse wheel up). | |
| Public | property Input_ZoomOut: TInputShortcut read FInput_ZoomOut; |
|
This item is declared in ancestor TCastleNavigation. Bring camera further from the model. Works only if ZoomEnabled. By deafult mwDown (mouse wheel down). | |
| Published | property FullSize default true; |
|
This item is declared in ancestor TCastleNavigation. By default this captures events from whole parent, which should be whole Viewport. | |
| Published | property EditorSelectOnHover default false; |
|
This item is declared in ancestor TCastleNavigation. By default false, as this is invisible and would obscure viewport. | |
| Published | property ZoomEnabled: Boolean read FZoomEnabled write FZoomEnabled default false; |
|
This item is declared in ancestor TCastleNavigation.
Enable zooming in / out. Depending on the projection, zooming either moves camera or scales the projection size. When | |
| Published | property CheckCollisions: Boolean read FCheckCollisions write FCheckCollisions default true; |
|
This item is declared in ancestor TCastleNavigation. Check collisions when moving with the environment. Note: some descendants may ignore it for some operations. Right now, TCastleWalkNavigation checks is always, but TCastleExamineNavigation checks it only at zooming. But future engine versions may harden the collision checks (to make them always), so be sure to set | |
| Public | property PreferGravityUpForRotations: boolean
read FPreferGravityUpForRotations write FPreferGravityUpForRotations default true; |
|
If With Note that you can change it freely at runtime, and when you set With PreferGravityUpForMoving, this affects moving: horizontal moving (forward, backward, strafe), and vertical moving (Input_Jump and Input_Crouch when Gravity is
| |
| Public | property PreferGravityUpForMoving: boolean
read FPreferGravityUpForMoving write FPreferGravityUpForMoving default true; |
|
This item has no description. | |
| Public | property MinAngleFromGravityUp: Single
read FMinAngleFromGravityUp write FMinAngleFromGravityUp
default DefaultMinAngleFromGravityUp; |
|
This sets the minimal angle (in radians) between GravityUp and Camera.Direction, and also between -GravityUp and Camera.Direction. This way vertical rotations (like Input_UpRotate, Input_DownRotate) are "bounded" to not allow player to do something strange, i.e. bow your head too much and raise your head too much. This is used only when PreferGravityUpForRotations is This must be always between 0 and Pi/2. Value of Pi/2 will effectively disallow vertical rotations (although you should rather do this in a "cleaner way" by calling MakeClear on Input_UpRotate and Input_DownRotate). | |
| Public | property FallSpeedStart: Single
read FFallSpeedStart write FFallSpeedStart
default DefaultFallSpeedStart; |
|
Initial speed of falling down. Of course this is used only when Gravity is true. Note that while falling down, the camera will actually fall with greater and greated speed (this adds more realism to the gravity effect...). Note that this is always relative to Camera.Direction length. Camera.Direction determines moving speed — and so it determines also falling speed. The default DefaultFallSpeedStart is chosen to be something sensible, to usually get nice effect of falling. You can change it at any time, but note that if you change this while Falling is | |
| Public | property FallSpeedIncrease: Single
read FFallSpeedIncrease write FFallSpeedIncrease
default DefaultFallSpeedIncrease; |
|
When falling down, the speed increases. Set this to 1.0 to fall down with constant speed (taken from FallSpeedStart). | |
| Public | property Falling: boolean read FFalling write FFalling; |
|
Are we currently falling down because of gravity. | |
| Public | property FallingEffect: boolean
read FFallingEffect write FFallingEffect default true; |
|
Make a nice dizzying camera effect when falling down. This adds temporary camera rotations simulating that you rotate randomly and helplessly when falling down. Of course this is meaningfull only when Gravity works. Note that changing it from | |
| Public | property IsJumping: boolean read FIsJumping; |
|
We are in the middle of a "jump" move right now. | |
| Public | property IsCrouching: boolean read FIsCrouching; |
|
Is player crouching right now. | |
| Public | property FallingOnTheGround: boolean read FFallingOnTheGround; |
|
| |
| Public | property IsOnTheGround: boolean read FIsOnTheGround; |
|
This is You can use this e.g. to make some effects when player is on some special ground (standing or walking), e.g. hurt player when he's standing on some toxical ground. See also
| |
| Public | property IsWalkingOnTheGround: boolean read FIsWalkingOnTheGround; |
|
This is The intention is that you can use this to make some "footsteps" sound for the player. | |
| Public | property IsAbove: boolean read FIsAbove; |
|
Last known information about whether camera is over the ground. These are updated continuously only when Gravity is We do not (and, currently, cannot) track here if AboveGround pointer will be eventually released (which may happen if you release your 3D scene, or rebuild scene causing octree rebuild). This is not a problem for navigation class, since we do not use this pointer for anything. But if you use this pointer, then you may want to take care to eventually set it to AboveHeight is in world coordinates (not camera coordinates). | |
| Public | property AboveHeight: Single read FAboveHeight; |
|
This item has no description. | |
| Public | property AboveGround: PTriangle read FAboveGround write FAboveGround; |
|
This item has no description. | |
| Public | property Input_Forward: TInputShortcut read FInput_Forward; |
|
This item has no description. | |
| Public | property Input_Backward: TInputShortcut read FInput_Backward; |
|
This item has no description. | |
| Public | property Input_LeftRotate: TInputShortcut read FInput_LeftRotate; |
|
This item has no description. | |
| Public | property Input_RightRotate: TInputShortcut read FInput_RightRotate; |
|
This item has no description. | |
| Public | property Input_LeftRot: TInputShortcut read FInput_LeftRotate; deprecated 'use Input_LeftRotate'; |
|
Warning: this symbol is deprecated: use Input_LeftRotate This item has no description. | |
| Public | property Input_RightRot: TInputShortcut read FInput_RightRotate; deprecated 'use Input_RightRotate'; |
|
Warning: this symbol is deprecated: use Input_RightRotate This item has no description. | |
| Public | property Input_LeftStrafe: TInputShortcut read FInput_LeftStrafe; |
|
This item has no description. | |
| Public | property Input_RightStrafe: TInputShortcut read FInput_RightStrafe; |
|
This item has no description. | |
| Public | property Input_UpRotate: TInputShortcut read FInput_UpRotate; |
|
This item has no description. | |
| Public | property Input_DownRotate: TInputShortcut read FInput_DownRotate; |
|
This item has no description. | |
| Public | property Input_IncreasePreferredHeight: TInputShortcut read FInput_IncreasePreferredHeight; |
|
This item has no description. | |
| Public | property Input_DecreasePreferredHeight: TInputShortcut read FInput_DecreasePreferredHeight; |
|
This item has no description. | |
| Public | property Input_GravityUp: TInputShortcut read FInput_GravityUp; |
|
This item has no description. | |
| Public | property Input_Run: TInputShortcut read FInput_Run; |
|
This item has no description. | |
| Public | property Input_MoveSpeedInc: TInputShortcut read FInput_MoveSpeedInc; |
|
Change the MoveSpeed. | |
| Public | property Input_MoveSpeedDec: TInputShortcut read FInput_MoveSpeedDec; |
|
This item has no description. | |
| Public | property Input_Jump: TInputShortcut read FInput_Jump; |
|
Jumping and crouching (when Gravity = | |
| Public | property Input_Crouch: TInputShortcut read FInput_Crouch; |
|
This item has no description. | |
| Public | property MoveForward: boolean read FMoveForward write FMoveForward; |
|
Move forward, just like Input_Forward would be pressed. | |
| Public | property MoveBackward: boolean read FMoveBackward write FMoveBackward; |
|
Move backward, just like Input_Backward would be pressed. | |
| Public | property RotationHorizontalPivot: Single
read FRotationHorizontalPivot write FRotationHorizontalPivot
default 0; deprecated 'use TCastleThirdPersonNavigation for real 3rd-person navigation'; |
|
Warning: this symbol is deprecated: use TCastleThirdPersonNavigation for real 3rd-person navigation
Horizontal rotation can rotate around a vector that is | |
| Published | property MouseLook; |
|
This item has no description. Showing description inherited from TCastleMouseLookNavigation.MouseLook. Use mouse look to navigate (rotate the camera). This also makes mouse cursor of Container hidden, and forces mouse position to the middle of the window (to avoid the situation when mouse movement is blocked by screen borders). Setting this property at design-time (in CGE editor) does not activate the mouse look in CGE editor. It only controls the mouse look once the application is running. | |
| Published | property MouseLookHorizontalSensitivity; |
|
This item has no description. Showing description inherited from TCastleMouseLookNavigation.MouseLookHorizontalSensitivity. Mouse look sensitivity, if MouseLook is working. These properties specify how much angle change is produced by moving mouse by 1 pixel. | |
| Published | property MouseLookVerticalSensitivity; |
|
This item has no description. | |
| Published | property InvertVerticalMouseLook; |
|
This item has no description. Showing description inherited from TCastleMouseLookNavigation.InvertVerticalMouseLook.
If this is | |
| Published | property Radius; |
|
This item has no description. Showing description inherited from TCastleNavigation.Radius. The radius of a sphere around the camera that makes collisions with the world.
| |
| Published | property RotationHorizontalSpeed: Single
read FRotationHorizontalSpeed write FRotationHorizontalSpeed
default DefaultRotationHorizontalSpeed; |
|
Rotation keys speed, in radians per second. | |
| Published | property RotationVerticalSpeed: Single
read FRotationVerticalSpeed write FRotationVerticalSpeed
default DefaultRotationVerticalSpeed; |
|
This item has no description. | |
| Published | property MoveHorizontalSpeed: Single
read FMoveHorizontalSpeed write FMoveHorizontalSpeed default 1.0; |
|
Moving speeds. We move by distance Default values for all these speed properties is 1.0, so you simply move by 1 unit per second. | |
| Published | property MoveVerticalSpeed: Single
read FMoveVerticalSpeed write FMoveVerticalSpeed default 1.0; |
|
This item has no description. | |
| Published | property MoveSpeed: Single read FMoveSpeed write FMoveSpeed default 1.0; |
|
This item has no description. | |
| Published | property MoveSpeedMin: Single read FMoveSpeedMin write FMoveSpeedMin default DefaultMoveSpeedMin; |
|
Minimum and maximum values for possible MoveSpeed that user can make, using Input_MoveSpeedInc, Input_MoveSpeedInc. Note that code can still set MoveSpeed to any value, however small or large, these limits only apply to user changing speed by Input_MoveSpeedInc, Input_MoveSpeedInc. | |
| Published | property MoveSpeedMax: Single read FMoveSpeedMax write FMoveSpeedMax default DefaultMoveSpeedMax; |
|
This item has no description. | |
| Published | property MouseDraggingHorizontalRotationSpeed: Single
read FMouseDraggingHorizontalRotationSpeed write FMouseDraggingHorizontalRotationSpeed
default DefaultMouseDraggingHorizontalRotationSpeed; |
|
Speed (radians per pixel delta) of rotations by mouse dragging. Relevant only if niMouseDragging in Input and MouseDragMode is mdRotate or mdWalkRotate. Separate for horizontal and vertical, this way you can e.g. limit (or disable) vertical rotations, useful for games where you mostly look horizontally and accidentally looking up/down is more confusing than useful. | |
| Published | property MouseDraggingVerticalRotationSpeed: Single
read FMouseDraggingVerticalRotationSpeed write FMouseDraggingVerticalRotationSpeed
default DefaultMouseDraggingVerticalRotationSpeed; |
|
This item has no description. | |
| Published | property MouseDraggingMoveSpeed: Single
read FMouseDraggingMoveSpeed write FMouseDraggingMoveSpeed
default DefaultMouseDraggingMoveSpeed; |
|
Moving speed when mouse dragging. Relevant only when | |
| Published | property MouseDragMode: TMouseDragMode
read FMouseDragMode write FMouseDragMode default mdWalkRotate; |
|
What mouse dragging does. Used only when niMouseDragging in Input. | |
| Published | property Gravity: boolean
read FGravity write FGravity default true; |
|
This unlocks a couple of features and automatic behaviors related to gravity. Gravity always drags the camera down to -GravityUp. Summary of things done by gravity:
While there are many properties allowing you to control gravity behavior, most of them have initial values that should be sensible in all cases. The most important property you need to set yourself is PreferredHeight. Everything else should basically work auto-magically. Note that Gravity setting is independent from PreferGravityUpForRotations or PreferGravityUpForMoving settings — PreferGravityUpXxx say how the player controls work, Gravity says what happens to player due to ... well, due to gravity. | |
| Published | property PreferredHeight: Single
read FPreferredHeight write FPreferredHeight default DefaultPreferredHeight; |
|
Height above the ground, only used when TCastleWalkNavigation.Gravity is This must always be >= 0. You should set this to something greater than zero to get sensible behavior of some things related to TCastleWalkNavigation.Gravity. See CorrectPreferredHeight for important property of | |
| Published | property CrouchHeight: Single
read FCrouchHeight write FCrouchHeight default DefaultCrouchHeight; |
|
Preferred height when crouching. This is always mutiplied to PreferredHeight. This should always be <= 1 ( | |
| Published | property GrowSpeed: Single
read FGrowSpeed write FGrowSpeed
default DefaultGrowSpeed; |
|
When Gravity works and camera height above the ground is less than PreferredHeight, then we try to "grow", i.e. camera position increases along the GravityUp so that camera height above the ground is closer to PreferredHeight. This property (together with length of Camera.Direction, that always determines every moving speed) determines the speed of this growth. | |
| Published | property JumpMaxHeight: Single
read FJumpMaxHeight write FJumpMaxHeight
default DefaultJumpMaxHeight; |
|
How high can you jump ? The max jump distance is calculated as | |
| Published | property JumpHorizontalSpeedMultiply: Single
read FJumpHorizontalSpeedMultiply write FJumpHorizontalSpeedMultiply
default DefaultJumpHorizontalSpeedMultiply; |
|
Scales the speed of horizontal moving during jump. | |
| Published | property JumpTime: Single read FJumpTime write FJumpTime
default DefaultJumpTime; |
|
How fast do you jump up. This is the time, in seconds, in takes to reach MaxJumpDistance height when jumping. | |
| Published | property RunMultiplier: Single read FRunMultiplier write FRunMultiplier
default DefaultRunMultiplier; |
|
How much is the speed multiplied when running. This is used when Input_Run is pressed. The default value is 2.0, so running is twice as fast as walking. | |
| Published | property AllowSlowerRotations: boolean
read FAllowSlowerRotations write FAllowSlowerRotations
default true; |
|
If | |
| Published | property CheckModsDown: boolean
read FCheckModsDown write FCheckModsDown
default true; |
|
Do we check what key modifiers are pressed and do something differently based on it?
If If | |
| Published | property HeadBobbing: Single
read FHeadBobbing write FHeadBobbing default DefaultHeadBobbing; |
|
We may make a "head bobbing" effect, by moving the camera a bit up and down. This property mutiplied by PreferredHeight says how much head bobbing can move you along GravityUp. Set this to 0 to disable head bobbing. This must always be < 1.0. For sensible effects, this should be rather close to 0.0, for example 0.02. This is meaningfull only when TCastleWalkNavigation.Gravity works. | |
| Published | property HeadBobbingTime: Single
read FHeadBobbingTime write FHeadBobbingTime
default DefaultHeadBobbingTime; |
|
Controls head bobbing frequency. In the time of Note that if you do a footsteps sound in your game (see e.g. Example: controlling the footsteps sound) then you will want this property to match your footsteps sound length, to sound natural. Note: Often it sounds better to record two footsteps inside a single sound file, in which case the footstep sound length should be twice as long as this property. For example, record 2 steps inside a 1-second long footstep sound, and set this property to 0.5 a second (which happens to be a default). | |
| Published | property ClimbHeight: Single read FClimbHeight write FClimbHeight; |
|
The tallest height that you can climb only used when TCastleWalkNavigation.Gravity is This is reliable to prevent user from climbing stairs and such, when vertical walls are really vertical (not just steep-almost-vertical). It's not 100% reliable to prevent player from climbing steep hills. That's because, depending on how often an event processing occurs, you actually climb using less or more steps. So even a very steep hill can be always climbed on a computer with very fast speed, because with large FPS you effectively climb it using a lot of very small steps (assuming that FPS limit is not enabled, that is CastleWindow.TCastleApplication.LimitFPS or CastleControl.LimitFPS is zero). Remember that user can still try jumping to climb on high obstactes. See TCastleWalkNavigation.JumpMaxHeight for a way to control jumping. For a 100% reliable way to prevent user from reaching some point, that does not rely on specific navigation settings, you should build actual walls in 3D (invisible walls can be created by Collision.proxy in VRML/X3D). | |
Generated by PasDoc 0.17.0.snapshot.