Class TCastleDesktopPointerLock
Unit
Declaration
type TCastleDesktopPointerLock = class(TCastleAbstractPointerLock)
Description
Pointer lock implementation on desktops. We hide the mouse cursor (using TCastleContainer internal mechanism, so we override whatever cursor is set by TCastleUserInterface.Cursor or TCastleContainer.OverrideCursor). We keep repositioning mouse to the middle of the container.
Source: ui/castleuicontrols_pointer_lock_desktop.inc (line 27).
Hierarchy
- TObject
- TCastleAbstractPointerLock
- TCastleDesktopPointerLock
Overview
Methods
| Protected | procedure CancelActive; |
| Public | constructor Create(const AContainer: TCastleContainer); |
| Public | destructor Destroy; override; |
| Public | procedure AddUserCancelledListener(const Event: TNotifyEvent); |
| Public | procedure RemoveUserCancelledListener(const Event: TNotifyEvent); |
| Protected | procedure ActiveChanged(const NewValue: Boolean); override; |
| Protected | function Delta(const Event: TInputMotion): TVector2; override; |
| Public | procedure InternalIgnoreNextMotion; override; |
Properties
| Protected | property Container: TCastleContainer read FContainer; |
| Public | property Active: Boolean read FActive write SetActive; |
| Public | property Controller: TCastleUserInterface read FController write SetController; |
Description
Methods
| Protected | procedure CancelActive; |
|
This item is declared in ancestor TCastleAbstractPointerLock.
Set Active to Descendants are responsible to reset their own state before/after calling this, since this does not call ActiveChanged, so descendants are not notified about the cancellation in any other way. E.g. web implementation sets "FEffective := false" before calling this. Source: ui/castleuicontrols_pointer_lock_abstract.inc (line 165). | |
| Public | constructor Create(const AContainer: TCastleContainer); |
|
This item is declared in ancestor TCastleAbstractPointerLock. This item has no description. Source: ui/castleuicontrols_pointer_lock_abstract.inc (line 195). | |
| Public | destructor Destroy; override; |
|
This item is declared in ancestor TCastleAbstractPointerLock. This item has no description. Source: ui/castleuicontrols_pointer_lock_abstract.inc (line 196). | |
| Public | procedure AddUserCancelledListener(const Event: TNotifyEvent); |
|
This item is declared in ancestor TCastleAbstractPointerLock.
Called when user cancels pointer lock, e.g. by pressing Escape key on web. When this is triggered, the Active property is already set to Source: ui/castleuicontrols_pointer_lock_abstract.inc (line 213). | |
| Public | procedure RemoveUserCancelledListener(const Event: TNotifyEvent); |
|
This item is declared in ancestor TCastleAbstractPointerLock. This item has no description. Source: ui/castleuicontrols_pointer_lock_abstract.inc (line 214). | |
| Protected | procedure ActiveChanged(const NewValue: Boolean); override; |
|
This item has no description. Showing description inherited from TCastleAbstractPointerLock.ActiveChanged. Start or stop mouse look. Source: ui/castleuicontrols_pointer_lock_desktop.inc (line 33). | |
| Protected | function Delta(const Event: TInputMotion): TVector2; override; |
|
This item has no description. Showing description inherited from TCastleAbstractPointerLock.Delta.
Read current This is internally used by container to set TInputMotion.Delta before TInputMotion is passed to TCastleUserInterface.Motion events. This is called exactly once per motion event (so it doesn't need to be deterministic based on Event; on desktop it will indeed do some side-effects like repositioning mouse). Always returns zero if Active is It also returns zero if Active is The returned value is in final device pixels, so it is not affected by UI scale. If you want to adjust to UI scale (so user will have to move mouse by more pixels, when on a larger screen, when UI is larger) then just use Source: ui/castleuicontrols_pointer_lock_desktop.inc (line 34). | |
| Public | procedure InternalIgnoreNextMotion; override; |
|
This item has no description. Source: ui/castleuicontrols_pointer_lock_desktop.inc (line 36). | |
Properties
| Protected | property Container: TCastleContainer read FContainer; |
|
This item is declared in ancestor TCastleAbstractPointerLock. Container performing this pointer lock logic. Source: ui/castleuicontrols_pointer_lock_abstract.inc (line 154). | |
| Public | property Active: Boolean read FActive write SetActive; |
|
This item is declared in ancestor TCastleAbstractPointerLock.
Enable or disable pointer lock. Note that on some platforms (web) user can cancel pointer lock at any time, in which case this property turns to Source: ui/castleuicontrols_pointer_lock_abstract.inc (line 203). | |
| Public | property Controller: TCastleUserInterface read FController write SetController; |
|
This item is declared in ancestor TCastleAbstractPointerLock.
Optionally, when requesting pointer lock (by setting Active to This controller, and not others, should process deltas during pointer lock. This controller should also set Active to Guaranteed effects of setting this:
Source: ui/castleuicontrols_pointer_lock_abstract.inc (line 248). | |
Generated by PasDoc 1.0.4.