Class TCastleContainer
Unit
Declaration
type TCastleContainer = class abstract(TComponent)
Description
Abstract user interface container. Connects OpenGL context management code with Castle Game Engine controls (TCastleUserInterface, that is the basis for all our 2D and 3D rendering). When you use TCastleWindow (a window) or TCastleControl (Lazarus component), they provide you a non-abstract implementation of TCastleContainer
.
Basically, this class manages a Controls list.
We pass our inputs (mouse / key / touch events) to the controls on this list. Input goes to the front-most (that is, last on the Controls list) control under the event position (or mouse position, or the appropriate touch position). We use TCastleUserInterface.CapturesEventsAtPosition to decide this (by default it simply checks control's TCastleUserInterface.RenderRect vs the given position). As long as the event is not handled, we search for the next control that can handle this event and returns TCastleUserInterface.CapturesEventsAtPosition = True
.
We also call various methods to every control. These include TCastleUserInterface.Update, TCastleUserInterface.Render, TCastleUserInterface.Resize.
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleContainer
Overview
Fields
nested const DefaultBackgroundColor: TVector4 = (X: 0.1; Y: 0.1; Z: 0.1; W: 1); |
Methods
procedure Notification(AComponent: TComponent; Operation: TOperation); override; |
|
procedure SetInternalCursor(const Value: TMouseCursor); virtual; |
|
function GetMousePosition: TVector2; virtual; |
|
procedure SetMousePosition(const Value: TVector2); virtual; |
|
function GetTouches(const Index: Integer): TTouch; virtual; |
|
function SettingMousePositionCausesMotion: Boolean; virtual; |
|
constructor Create(AOwner: TComponent); override; |
|
destructor Destroy; override; |
|
procedure EventOpen(const OpenWindowsCount: Cardinal); virtual; |
|
procedure EventClose(const OpenWindowsCount: Cardinal); virtual; |
|
function EventPress(const Event: TInputPressRelease): boolean; virtual; |
|
function EventRelease(const Event: TInputPressRelease): boolean; virtual; |
|
procedure EventUpdate; virtual; |
|
procedure EventMotion(const Event: TInputMotion); virtual; |
|
function AllowSuspendForInput: boolean; |
|
procedure EventBeforeRender; virtual; |
|
procedure EventRender; virtual; |
|
procedure EventResize; virtual; |
|
function EventJoyAxisMove(const JoyID, Axis: Byte): boolean; virtual; |
|
function EventJoyButtonPress(const JoyID, Button: Byte): boolean; virtual; |
|
function EventSensorRotation(const X, Y, Z, Angle: Double; const SecondsPassed: Single): boolean; virtual; |
|
function EventSensorTranslation(const X, Y, Z, Length: Double; const SecondsPassed: Single): boolean; virtual; |
|
function Controls: TInternalChildrenControls; |
|
procedure Invalidate; virtual; |
|
function GLInitialized: boolean; virtual; |
|
function Width: Integer; virtual; abstract; |
|
function Height: Integer; virtual; abstract; |
|
function Rect: TRectangle; virtual; |
|
function ScaledStatusBarHeight: Cardinal; virtual; |
|
function UnscaledWidth: Single; |
|
function UnscaledHeight: Single; |
|
function UnscaledRect: TFloatRectangle; |
|
function StatusBarHeight: Single; |
|
function Dpi: Single; virtual; |
|
function Focused: boolean; virtual; |
|
function TouchesCount: Integer; virtual; |
|
procedure RenderControl(const Control: TCastleUserInterface; const ViewportRect: TRectangle); |
|
procedure SaveScreen(const URL: string); overload; |
|
function SaveScreen: TRGBImage; overload; |
|
function SaveScreen(const SaveRect: TRectangle): TRGBImage; overload; virtual; |
|
function SaveScreen(const SaveRect: TFloatRectangle): TRGBImage; overload; |
|
function SaveScreenRgba(const SaveRect: TRectangle): TRGBAlphaImage; overload; |
|
function SaveScreenRgba: TRGBAlphaImage; overload; |
|
function SaveScreenToDefaultFile: String; |
|
procedure MouseLookPress; |
|
procedure MouseLookUpdate; |
|
function MouseLookDelta(const Event: TInputMotion; const ControlRect: TFloatRectangle): TVector2; overload; |
|
function MouseLookDelta(const Event: TInputMotion): TVector2; overload; deprecated 'use MouseLookDelta overload with ControlRect parameter'; |
|
procedure ReleaseCapture(const C: TCastleUserInterface); |
|
procedure LoadSettings(const SettingsUrl: String); |
Properties
property OnOpen: TContainerEvent read FOnOpen write FOnOpen; |
|
property OnOpenObject: TContainerObjectEvent read FOnOpenObject write FOnOpenObject; |
|
property OnBeforeRender: TContainerEvent read FOnBeforeRender write FOnBeforeRender; |
|
property OnRender: TContainerEvent read FOnRender write FOnRender; |
|
property OnResize: TContainerEvent read FOnResize write FOnResize; |
|
property OnClose: TContainerEvent read FOnClose write FOnClose; |
|
property OnCloseObject: TContainerObjectEvent read FOnCloseObject write FOnCloseObject; |
|
property OnPress: TInputPressReleaseEvent read FOnPress write FOnPress; |
|
property OnRelease: TInputPressReleaseEvent read FOnRelease write FOnRelease; |
|
property OnMotion: TInputMotionEvent read FOnMotion write FOnMotion; |
|
property OnUpdate: TContainerEvent read FOnUpdate write FOnUpdate; |
|
property Cursor: TMouseCursor write SetInternalCursor; deprecated 'do not set this, engine will override this. Set TCastleUserInterface.Cursor of your UI controls to control the Cursor.'; |
|
property InternalCursor: TMouseCursor write SetInternalCursor; |
|
property UIScale: Single read FUIScale; |
|
property Focus: TCastleUserInterfaceList read FFocus; |
|
property MousePosition: TVector2
read GetMousePosition write SetMousePosition; |
|
property MousePressed: TCastleMouseButtons read FMousePressed write FMousePressed; |
|
property Pressed: TKeysPressed read FPressed; |
|
property Fps: TFramesPerSecond read FFps; |
|
property Touches[constIndex:Integer]: TTouch read GetTouches; |
|
property Context: TRenderContext read FContext; |
|
property ForceCaptureInput: TCastleUserInterface
read FForceCaptureInput write SetForceCaptureInput; |
|
property OverrideCursor: TMouseCursor read FOverrideCursor write FOverrideCursor
default mcDefault; |
|
property TooltipDelay: Single read FTooltipDelay write FTooltipDelay
default DefaultTooltipDelay; |
|
property TooltipDistance: Cardinal read FTooltipDistance write FTooltipDistance
default DefaultTooltipDistance; |
|
property UIScaling: TUIScaling
read FUIScaling write SetUIScaling default usNone; |
|
property UIReferenceWidth: Single
read FUIReferenceWidth write SetUIReferenceWidth default 0; |
|
property UIReferenceHeight: Single
read FUIReferenceHeight write SetUIReferenceHeight default 0; |
|
property UIExplicitScale: Single
read FUIExplicitScale write SetUIExplicitScale default 1.0; |
|
property DefaultFont: TCastleAbstractFont read FDefaultFont write FDefaultFont; |
|
property BackgroundEnable: Boolean
read FBackgroundEnable write FBackgroundEnable default true; |
|
property BackgroundColor: TCastleColor
read FBackgroundColor write FBackgroundColor; |
|
property InputInspector: TInputInspector read FInputInspector; |
|
property InspectorKey: TKey read GetInspectorKey write SetInspectorKey; deprecated 'use InputInspector'; |
Description
Fields
nested const DefaultBackgroundColor: TVector4 = (X: 0.1; Y: 0.1; Z: 0.1; W: 1); |
|
Methods
procedure Notification(AComponent: TComponent; Operation: TOperation); override; |
|
procedure SetInternalCursor(const Value: TMouseCursor); virtual; |
|
function GetMousePosition: TVector2; virtual; |
|
procedure SetMousePosition(const Value: TVector2); virtual; |
|
function GetTouches(const Index: Integer): TTouch; virtual; |
|
function SettingMousePositionCausesMotion: Boolean; virtual; |
|
Does setting MousePosition also causes Motion / OnMotion events. While we tried to make everything work reliably always, the mouse look logic just needs to know this. It is easy to test it in practice. Just run examples/window/window_events.lpr, move mouse around, and press "5" (this does "MousePosition := window middle"). |
constructor Create(AOwner: TComponent); override; |
|
destructor Destroy; override; |
|
procedure EventOpen(const OpenWindowsCount: Cardinal); virtual; |
|
Propagate the event to all the Controls and to our own OnXxx callbacks. These methods are called automatically when necessary, so usually you don't call them. But in rare cases, it makes sense to "fake" some event by calling these methods. Most of these methods are called automatically by the container owner, like TCastleWindow or TCastleControl. Some are called by EventUpdate, which is special in this regard, as EventUpdate is not only responsible for calling TCastleUserInterface.Update on all Controls, it also calls EventJoyAxisMove, EventJoyButtonPress, EventSensorRotation, EventSensorTranslation. |
procedure EventClose(const OpenWindowsCount: Cardinal); virtual; |
|
function EventPress(const Event: TInputPressRelease): boolean; virtual; |
|
function EventRelease(const Event: TInputPressRelease): boolean; virtual; |
|
procedure EventUpdate; virtual; |
|
procedure EventMotion(const Event: TInputMotion); virtual; |
|
function AllowSuspendForInput: boolean; |
|
procedure EventBeforeRender; virtual; |
|
procedure EventRender; virtual; |
|
procedure EventResize; virtual; |
|
function EventJoyAxisMove(const JoyID, Axis: Byte): boolean; virtual; |
|
function EventJoyButtonPress(const JoyID, Button: Byte): boolean; virtual; |
|
function EventSensorRotation(const X, Y, Z, Angle: Double; const SecondsPassed: Single): boolean; virtual; |
|
function EventSensorTranslation(const X, Y, Z, Length: Double; const SecondsPassed: Single): boolean; virtual; |
|
function Controls: TInternalChildrenControls; |
|
Controls listening for events (user input, resize, and such) of this container. Usually you explicitly add / remove controls to this list using the Controls.InsertFront or Controls.InsertBack methods. Freeing any control that is on this list automatically removes it from this list (we use the TComponent.Notification mechanism). Controls on the list should be specified in back-to-front order. That is, controls at the beginning of this list are rendered first, and are last to catch some events, since the rest of controls cover them. |
procedure Invalidate; virtual; |
|
Redraw the contents of of this window, at the nearest suitable time. This method does not redraw immediately (it does not call EventBeforeRender and EventRender inside), it only makes sure that they will be called very soon. Calling this on a closed container (with GLInitialized = |
function GLInitialized: boolean; virtual; |
|
Is the OpenGL context initialized. |
function Width: Integer; virtual; abstract; |
|
Container size, in pixels. This is expressed in real device pixels. Prefer using UnscaledWidth instead of this. UnscaledWidth is more natural when you use UI scaling (UIScaling), and it's simply equal to |
function Height: Integer; virtual; abstract; |
|
Container size, in pixels. This is expressed in real device pixels. Prefer using UnscaledHeight instead of this. UnscaledHeight is more natural when you use UI scaling (UIScaling), and it's simply equal to |
function Rect: TRectangle; virtual; |
|
Container size, in pixels. This is expressed in real device pixels, using Width and Height. Prefer using UnscaledRect instead of this. UnscaledRect is more natural when you use UI scaling (UIScaling), and it's simply equal to |
function ScaledStatusBarHeight: Cardinal; virtual; |
|
Translucent status bar height in the container, in pixels. This is expressed in real device pixels. Prefer using StatusBarHeight instead of this. |
function UnscaledWidth: Single; |
|
Container width as seen by controls with UI scaling. In other words, this is the real Width with UI scaling reversed (divided). Suitable to adjust size of your UI controls to container, when UI scaling is used. This is equivalent to just Width when UIScaling is usNone (default). Note: the name "unscaled" may seem a little unintuitive, but it's consistent. We call UI sizes "scaled" when they are expressed in real device pixels, because they are usually calculated as "desired size * UIScaling". So the UI size is "unscaled" when it's expressed in your "desired size". We usually don't use the prefix "unscaled" (e.g. TCastleUserInterface.Width is "unscaled" by we don't call it " See also
|
function UnscaledHeight: Single; |
|
Container height as seen by controls with UI scaling. See also
|
function UnscaledRect: TFloatRectangle; |
|
Container rectangle as seen by controls with UI scaling. See also
|
function StatusBarHeight: Single; |
|
Translucent status bar height inside the container as seen by controls with UI scaling. Status bar occupies the top part of the container height. Invisible status bar returns height equal zero. See also
|
function Dpi: Single; virtual; |
|
Dots per inch, specifying the relation of screen pixels to physical size. |
function Focused: boolean; virtual; |
|
Is the window focused now, which means that keys/mouse events are directed to this window. |
function TouchesCount: Integer; virtual; |
|
Count of currently active touches (mouse or fingers pressed) on the screen. See also
|
procedure RenderControl(const Control: TCastleUserInterface; const ViewportRect: TRectangle); |
|
Render a TCastleUserInterface (along with all it's children). This method can be used to render UI control into an image, TDrawableImage, when it is surrounded by TDrawableImage.RenderToImageBegin and TDrawableImage.RenderToImageEnd. See CGE examples/viewport_and_scenes/render_3d_to_image/ . It can also be used with more low-level TGLRenderToTexture. See CGE examples/viewport_and_scenes/render_3d_to_texture_and_use_as_quad/ . This is a good method to render the UI control off-screen. It can render any UI control, including e.g. TCastleViewport with 3D stuff inside TCastleScene. The contents of the Controls list doesn't matter for this method. In particular, it doesn't matter if the Control (given as a parameter) is present on the list of current Controls. This method explicitly renders the given Control parameter (and it's children), nothing more, nothing less. More details what this method does:
|
procedure SaveScreen(const URL: string); overload; |
|
Capture the current container (window) contents to an image (or straight to an image file, like png). Note that only capturing from the double-buffered OpenGL windows (which the default for our TCastleWindow and TCastleControl) is reliable. Internally, these methods may need to redraw the screen to the back buffer, because that's the only guaranteed way to capture OpenGL drawing (you have to capture the back buffer, before swap). |
function SaveScreen: TRGBImage; overload; |
|
function SaveScreen(const SaveRect: TRectangle): TRGBImage; overload; virtual; |
|
function SaveScreen(const SaveRect: TFloatRectangle): TRGBImage; overload; |
|
function SaveScreenRgba(const SaveRect: TRectangle): TRGBAlphaImage; overload; |
|
Capture the current container (window) contents to an image with alpha. An example: { TCastleContainer.SaveScreenRgba example. This example relies on OpenGL color buffer that can store alpha information, which you request by "Window.AlphaBits := 8". An alternative approach, without needing "Window.AlphaBits := xxx", is to initialize FBO with color framebuffer with alpha channel, and render using this Fbo, like this: Fbo := TGLRenderToTexture.Create(Window.Width, Window.Height); Fbo.Buffer := tbNone; Fbo.ColorBufferAlpha := true; Fbo.GLContextOpen; Fbo.RenderBegin; ... Fbo.RenderEnd; } uses SysUtils, CastleWindow, CastleLog, CastleVectors, CastleUIControls, CastleScene, CastleViewport, CastleKeysMouse, CastleImages, CastleCameras; procedure Press(Container: TCastleContainer; const Event: TInputPressRelease); var Image: TRGBAlphaImage; begin if Event.IsKey(keyF5) then begin Image := Container.SaveScreenRgba; try SaveImage(Image, 'save_screen_rgba.png'); finally FreeAndNil(Image) end; end; end; var Window: TCastleWindow; Viewport: TCastleViewport; Scene: TCastleScene; begin Window := TCastleWindow.Create(Application); // We must have buffer that stores alpha information, not only RGB Window.AlphaBits := 8; // Initially fill buffer with transparent white. // When displaying, the window will be white, but it will be saved as transparent white. Window.Container.BackgroundColor := Vector4(1, 1, 1, 0); Window.OnPress := @Press; Window.Open; Viewport := TCastleViewport.Create(Application); Viewport.FullSize := true; Viewport.AutoCamera := true; Viewport.InsertBack(TCastleExamineNavigation.Create(Application)); Viewport.Transparent := true; // do not fill parent with Viewport.BackgroundColor Window.Controls.InsertFront(Viewport); Scene := TCastleScene.Create(Application); Scene.Load('castle-data:/teapot.x3dv'); Scene.Spatial := [ssRendering, ssDynamicCollisions]; Scene.ProcessEvents := true; Viewport.Items.Add(Scene); Viewport.Items.MainScene := Scene; Application.Run; end.
|
function SaveScreenRgba: TRGBAlphaImage; overload; |
|
function SaveScreenToDefaultFile: String; |
|
Capture the current container (window) contents to an image and save it to file, following the current platform/user preferred directory to store screenshots. On Windows, this saves files to user's "My Pictures" directory. On Unix (using freedesktop standard) this saves files to directory like ˜/Pictures . On macOS, this saves files to the home directory right now. On other platforms, it may follow the most established convention, or abort if no place (where we have permissions to store screenshots) exists. You can use SaveScreenPath yourself to have more control over the target location. Returns the saved file URL, so that you can e.g. show it to user. |
procedure MouseLookPress; |
|
For tracking mouse look. See MouseLookDelta. |
procedure MouseLookUpdate; |
|
For tracking mouse look. See MouseLookDelta. |
function MouseLookDelta(const Event: TInputMotion; const ControlRect: TFloatRectangle): TVector2; overload; |
|
Read mouse position delta from ControlRect middle, and try to set mouse position to ControlRect middle. ControlRect is usually the container rectangle (in final device coordinates) but in general it should be the rectangle of control over which we should do mouse look (so TCastleUserInterface.RenderRect). This can be used to perform "mouse look" or a similar effect, when user doesn't see the mouse cursor, but user can move something by dragging with mouse. Moreover, user should not notice any "bounds" to this dragging (that's why we try to keep mouse position in ControlRect middle, to avoid screen borders from acting as constrains on mouse movement). This is automatically used by TCastleWalkNavigation.MouseLook. You can use it yourself for custom effects "like mouse look". The template to use this is below. See the CGE example examples/user_interface/dragging_test/ for a working code demonstrating this. function TMyState.Press(const Event: TInputPressRelease): Boolean; begin Result := inherited; if Result then Exit; if Event.IsMouseButton(buttonLeft) then begin Drag := true; Cursor := mcForceNone; Container.MouseLookPress; end; end; function TMyState.Release(const Event: TInputPressRelease): Boolean; begin Result := inherited; if Result then Exit; if Event.IsMouseButton(buttonLeft) then begin Drag := false; Cursor := mcDefault; end; end; procedure TMyState.Update(const SecondsPassed: Single; var HandleInput: Boolean); begin inherited; if Drag then Container.MouseLookUpdate; end; function TNewFightUi.Motion(const Event: TInputMotion): Boolean; var Delta: TVector2; begin Result := inherited; if Result then Exit; if Drag then begin Delta := Container.MouseLookDelta(Event, Container.Rect); // ... // Use Delta to perform any logic you want. // It may be zero if mouse was not positioned correctly yet, // just make sure that Delta=zero does nothing. // You can use Delta / UiScale to adjust to UI scale // (user will then have to move mouse by more pixels on a larger screen to achieve the same Delta). // ... end; end; |
function MouseLookDelta(const Event: TInputMotion): TVector2; overload; deprecated 'use MouseLookDelta overload with ControlRect parameter'; |
|
Warning: this symbol is deprecated: use MouseLookDelta overload with ControlRect parameter |
procedure ReleaseCapture(const C: TCastleUserInterface); |
|
When the control accepts the "press" event, it automatically captures the following motion and release events, hijacking them from other controls, regardless of the mouse cursor position. This is usually desirable, to allow the control to handle the dragging. But sometimes you want to cancel the dragging, and allow other controls to handle the following motion and release events, in which case calling this method helps. |
procedure LoadSettings(const SettingsUrl: String); |
|
Load visual settings from an XML file. See https://castle-engine.io/manual_castle_settings.php for a documentation of the file format. This loads UIScaling, UIReferenceWidth, UIReferenceHeight, DefaultFont. In the future, it may load more things configurable by the CGE editor and CastleSettings.xml file. |
Properties
property OnOpen: TContainerEvent read FOnOpen write FOnOpen; |
|
These should only be get/set by a container owner, like TCastleWindow or TCastleControl. |
property OnOpenObject: TContainerObjectEvent read FOnOpenObject write FOnOpenObject; |
|
property OnBeforeRender: TContainerEvent read FOnBeforeRender write FOnBeforeRender; |
|
property OnRender: TContainerEvent read FOnRender write FOnRender; |
|
property OnResize: TContainerEvent read FOnResize write FOnResize; |
|
property OnClose: TContainerEvent read FOnClose write FOnClose; |
|
property OnCloseObject: TContainerObjectEvent read FOnCloseObject write FOnCloseObject; |
|
property OnPress: TInputPressReleaseEvent read FOnPress write FOnPress; |
|
property OnRelease: TInputPressReleaseEvent read FOnRelease write FOnRelease; |
|
property OnMotion: TInputMotionEvent read FOnMotion write FOnMotion; |
|
property OnUpdate: TContainerEvent read FOnUpdate write FOnUpdate; |
|
property Cursor: TMouseCursor write SetInternalCursor; deprecated 'do not set this, engine will override this. Set TCastleUserInterface.Cursor of your UI controls to control the Cursor.'; |
|
Warning: this symbol is deprecated: do not set this, engine will override this. Set TCastleUserInterface.Cursor of your UI controls to control the Cursor. |
property InternalCursor: TMouseCursor write SetInternalCursor; |
|
property UIScale: Single read FUIScale; |
|
Get the default UI scale of controls. Useful only when GLInitialized, when we know that our size is sensible. UI code should prefer to use TCastleUserInterface.UIScale, not directly accessing this |
property Focus: TCastleUserInterfaceList read FFocus; |
|
Returns the controls that should receive input events, from back to front. So the front-most control, that should receive events first, is last on this list. |
property MousePosition: TVector2
read GetMousePosition write SetMousePosition; |
|
Current mouse position. See TTouch.Position for a documentation how this is expressed. |
property MousePressed: TCastleMouseButtons read FMousePressed write FMousePressed; |
|
Currently pressed mouse buttons. When this changes, you're always notified by OnPress or OnRelease events. This value is always current, in particular it's already updated before we call events OnPress or OnRelease. |
property Pressed: TKeysPressed read FPressed; |
|
Keys currently pressed. |
property Fps: TFramesPerSecond read FFps; |
|
Measures application speed. |
property Touches[constIndex:Integer]: TTouch read GetTouches; |
|
Currently active Indexed from 0 to TouchesCount - 1. See also
|
property Context: TRenderContext read FContext; |
|
property ForceCaptureInput: TCastleUserInterface
read FForceCaptureInput write SetForceCaptureInput; |
|
Force passing events to the given control first, regardless if this control is under the mouse cursor. Before we even send events to the currently "capturing" control (for example, when you're dragging the slider, it is "capturing" mouse events until you release the mouse), they are send to this control. The control given here will always have focus (that is, TCastleUserInterface.Focused will be set to true shortly after it becomes the An example when this is useful is when you use camera MouseLook, and the associated viewport does not fill the full window (TCastleViewport.FullSize is The engine itself never automatically sets this property. It is up to your application code to set this, if you need. |
property OverrideCursor: TMouseCursor read FOverrideCursor write FOverrideCursor
default mcDefault; |
|
When this is not mcDefault, it sets the cursor, regardless of cursor specified at the TCastleUserInterface.Cursor value of the focused control. It even takes precedence over any control using mcForceNone (so it can force the cursor to be visible anyway). |
property TooltipDelay: Single read FTooltipDelay write FTooltipDelay
default DefaultTooltipDelay; |
|
Delay in seconds before showing the tooltip. |
property TooltipDistance: Cardinal read FTooltipDistance write FTooltipDistance
default DefaultTooltipDistance; |
|
property UIScaling: TUIScaling
read FUIScaling write SetUIScaling default usNone; |
|
Enable automatic scaling of the UI. This allows your UI to look correctly on various window sizes (great both for mobile and desktop, where window size may vary wildly). The idea is that you can set UI controls sizes (like TCastleUserInterface.Width, TCastleUserInterface.Height) to a simple constant values. And you should also set appropriate anchors (choose wisely whether to anchor e.g. to left or right, as the simulated window size still has variable aspect ratio). And the result will look good on any actual window size. All the controls will be scaled to fill the same window part. The scaling is actually done by scaling the coordinates, so there's no quality loss, whole rendering just adjusts to the actual window size in a smart way. See TUIScaling values for precise description how it works. |
property UIReferenceWidth: Single
read FUIReferenceWidth write SetUIReferenceWidth default 0; |
|
Reference width and height to which we fit the container size (as seen by TCastleUserInterface implementations) when UIScaling is usEncloseReferenceSize or usFitReferenceSize. See usEncloseReferenceSize and usFitReferenceSize for precise description how this works. Set both these properties, or set only one (and leave the other as zero). |
property UIReferenceHeight: Single
read FUIReferenceHeight write SetUIReferenceHeight default 0; |
|
property UIExplicitScale: Single
read FUIExplicitScale write SetUIExplicitScale default 1.0; |
|
Scale of the container size (as seen by TCastleUserInterface implementations) when UIScaling is usExplicitScale. See usExplicitScale for precise description how this works. |
property DefaultFont: TCastleAbstractFont read FDefaultFont write FDefaultFont; |
|
Default font (type, size) to be used by all user interface controls. Note that each UI control can customize the used font and/or size using properties TCastleUserInterfaceFont.CustomFont, TCastleUserInterfaceFont.FontSize. If this is |
property BackgroundEnable: Boolean
read FBackgroundEnable write FBackgroundEnable default true; |
|
Before rendering anything else, fill the color buffer with BackgroundColor. By default this is You can set this to
If you set this to |
property BackgroundColor: TCastleColor
read FBackgroundColor write FBackgroundColor; |
|
Color that fills the window by default. By default it is DefaultBackgroundColor, which is very dark gray. |
property InputInspector: TInputInspector read FInputInspector; |
|
Input (key, touch) to toggle the inspector at any point in the application. By default this is possible in debug builds, using key F8, or pressing 3 fingers for 1 second (latter is useful on multi-touch devices). |
property InspectorKey: TKey read GetInspectorKey write SetInspectorKey; deprecated 'use InputInspector'; |
|
Warning: this symbol is deprecated: use InputInspector Use InputInspector.Key now. |
Generated by PasDoc 0.16.0.