Class TCastleTheme
Unit
Declaration
type TCastleTheme = class(TCastleComponent)
Description
Theme for user interface controls.
You can customize Theme singleton to change the default look.
You can also create new instances of TCastleTheme
and use them for multiple controls, assigning to TCastleUserInterface.CustomTheme.
You can also use FallbackTheme to effectively disable any customizations and always use default hardcoded look.
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleComponent
- TCastleTheme
Overview
Fields
TooltipTextColor: TCastleColor; |
|
TextColor: TCastleColor; |
|
DisabledTextColor: TCastleColor; |
|
MessageTextColor: TCastleColor; |
|
MessageInputTextColor: TCastleColor; |
|
BarEmptyColor: TVector3Byte; |
|
BarFilledColor: TVector3Byte; |
|
BackgroundColor: TCastleColor; |
|
BackgroundOpaqueColor: TCastleColorRGB; |
|
LoadingBackgroundColor: TCastleColor; |
|
LoadingColor: TCastleColor; |
|
LoadingUIScaling: TUIScaling; |
|
LoadingUIReferenceWidth: Single; |
|
LoadingUIReferenceHeight: Single; |
|
LoadingUIExplicitScale: Single; |
|
ScrollBarWidth: Single; |
|
MinimumScrollbarSliderHeight: Single; |
|
DefaultLabelWhite: Boolean deprecated 'if you want the labels to be white, adjust TCastleLabel.Color to White after creating every TCastleLabel'; |
Methods
constructor Create(AOwner: TComponent); override; |
|
destructor Destroy; override; |
|
procedure Draw(const Rect: TFloatRectangle; const ImageType: TThemeImage; const UIScale: Single = 1.0); overload; |
|
procedure Draw(const Rect: TFloatRectangle; const ImageType: TThemeImage; const UIScale: Single; const Color: TCastleColor); overload; |
|
procedure Draw(const Rect: TRectangle; const ImageType: TThemeImage; const UIScale: Single = 1.0); overload; |
|
procedure Draw(const Rect: TRectangle; const ImageType: TThemeImage; const UIScale: Single; const Color: TCastleColor); overload; |
|
procedure DialogsLight; |
Properties
property Images[const ImageType: TThemeImage]: TCastleImage read GetImages write SetImages; deprecated 'use ImagesPersistent[...].Image'; |
|
property ImagesPersistent[const ImageType: TThemeImage]: TCastleImagePersistent read GetImagePersistent; |
|
property OwnsImages[const ImageType: TThemeImage]: boolean read GetOwnsImages write SetOwnsImages; deprecated 'use ImagesPersistent[...].OwnsImage'; |
|
property Corners[const ImageType: TThemeImage]: TVector4 read GetCorners write SetCorners; deprecated 'use ImagesPersistent[...].ProtectedSides'; |
|
property MessageFont: TCastleAbstractFont read FMessageFont write SetMessageFont; |
|
property OwnsMessageFont: boolean
read FOwnsMessageFont write FOwnsMessageFont default true; |
|
property LoadingTextColor: TCastleColor
read LoadingColor write LoadingColor; deprecated 'use LoadingColor'; |
|
property LoadingImageForWindowHeight: Single
read LoadingUIReferenceHeight write LoadingUIReferenceHeight; deprecated 'use LoadingUIReferenceHeight'; |
Description
Fields
TooltipTextColor: TCastleColor; |
|
This item has no description. |
TextColor: TCastleColor; |
|
This item has no description. |
DisabledTextColor: TCastleColor; |
|
This item has no description. |
MessageTextColor: TCastleColor; |
|
This item has no description. |
MessageInputTextColor: TCastleColor; |
|
This item has no description. |
BarEmptyColor: TVector3Byte; |
|
This item has no description. |
BarFilledColor: TVector3Byte; |
|
This item has no description. |
BackgroundColor: TCastleColor; |
|
Color layer displayed between modal dialogs (CastleMessages, CastleDialogViews, TGLModeFrozenScreen) and their background (view underneath or a screenshot). Default is (0, 0, 0, 0.25), making things underneath darker, which helps dialog to stand out. |
BackgroundOpaqueColor: TCastleColorRGB; |
|
Color used instead of BackgroundColor when InternalMessageFallbackLook is used. You can only customize the RGB values, alpha is always 1, so the resulting color is always opaque. It's a dark gray color (0.33, 0.33, 0.33) by default. |
LoadingBackgroundColor: TCastleColor; |
|
Colors used when displaying the loading image (by default just with the "Loading..." text) when application is loading (before proper CGE UI can be displayed). By default, See https://castle-engine.io/loading_image for an example how to set loading image. |
LoadingColor: TCastleColor; |
|
Colors used when displaying the loading image (by default just with the "Loading..." text) when application is loading (before proper CGE UI can be displayed). By default, LoadingBackgroundColor is black, and See https://castle-engine.io/loading_image for an example how to set loading image. |
LoadingUIScaling: TUIScaling; |
|
Adjust loading image following the UI scaling determined by these properties. They determine for what window reference size was the loading image prepared. The loading image is whatever you set at These properties deliberately match the behavior of TCastleContainer.UIScaling, TCastleContainer.UIReferenceWidth, TCastleContainer.UIReferenceHeight, TCastleContainer.UIExplicitScale. If these LoadingUIXxx properties are equal to the TCastleContainer.UIXxx properties, then the rendered image size will be precisely equal to how TCastleImageControl rendering of this image (with anchors set to middle) would look. The reason why these properties exist is that when rendering By default, we set |
LoadingUIReferenceWidth: Single; |
|
This item has no description. |
LoadingUIReferenceHeight: Single; |
|
This item has no description. |
LoadingUIExplicitScale: Single; |
|
This item has no description. |
ScrollBarWidth: Single; |
|
Width of scrollbar for TCastleScrollView. |
MinimumScrollbarSliderHeight: Single; |
|
Minumum scrollbar height, to be comfortably visible and draggable. |
Methods
constructor Create(AOwner: TComponent); override; |
|
This item has no description. |
destructor Destroy; override; |
|
This item has no description. |
procedure Draw(const Rect: TFloatRectangle; const ImageType: TThemeImage; const UIScale: Single = 1.0); overload; |
|
Draw the selected theme image on screen.
Parameters
|
procedure Draw(const Rect: TFloatRectangle; const ImageType: TThemeImage; const UIScale: Single; const Color: TCastleColor); overload; |
|
This item has no description. |
procedure Draw(const Rect: TRectangle; const ImageType: TThemeImage; const UIScale: Single = 1.0); overload; |
|
This item has no description. |
procedure Draw(const Rect: TRectangle; const ImageType: TThemeImage; const UIScale: Single; const Color: TCastleColor); overload; |
|
This item has no description. |
procedure DialogsLight; |
|
Set dialogs theme to light. |
Properties
property Images[const ImageType: TThemeImage]: TCastleImage read GetImages write SetImages; deprecated 'use ImagesPersistent[...].Image'; |
|
Warning: this symbol is deprecated: use ImagesPersistent[...].Image Theme images, represented as TCastleImage. Although they all have sensible defaults, you can also change them at any time. Simply create TCastleImage instance (e.g. by LoadImage function) and assign it here. Be sure to adjust also OwnsImages if you want the theme to automatically free the image when it's no longer used. The alpha channel of the image, if any, is automatically correctly used (for alpha test or alpha blending, see TDrawableImage). |
property ImagesPersistent[const ImageType: TThemeImage]: TCastleImagePersistent read GetImagePersistent; |
|
Images used to draw UI controls by default. You can adjust them e.g. to adjust how a default TCastleButton looks. Note that some controls have properties to override the "theme" look for a particular control, e.g. on a particular TCastleButton you can set TCastleButton.CustomBackground and TCastleButton.CustomBackgroundNormal. When adjusting these images, it is simplest to assign the image URL by setting TCastleImagePersistent.URL. See https://castle-engine.io/manual_2d_user_interface.php#section_theme . Adjust also TCastleImagePersistent.ProtectedSides to use 9-slice scaling. |
property OwnsImages[const ImageType: TThemeImage]: boolean read GetOwnsImages write SetOwnsImages; deprecated 'use ImagesPersistent[...].OwnsImage'; |
|
Warning: this symbol is deprecated: use ImagesPersistent[...].OwnsImage This item has no description. |
property Corners[const ImageType: TThemeImage]: TVector4 read GetCorners write SetCorners; deprecated 'use ImagesPersistent[...].ProtectedSides'; |
|
Warning: this symbol is deprecated: use ImagesPersistent[...].ProtectedSides Corners that determine how image on Images is stretched when drawing by TCastleTheme.Draw method. Together with assigning Images, adjust also this property. It is used for images rendered using TDrawableImage.Draw3x3, it determines how the image is stretched. The corners are specified as 4D vector, order like in CSS: top, right, down, left. |
property MessageFont: TCastleAbstractFont read FMessageFont write SetMessageFont; |
|
Font used by dialogs. Leave |
property OwnsMessageFont: boolean
read FOwnsMessageFont write FOwnsMessageFont default true; |
|
This item has no description. |
property LoadingTextColor: TCastleColor
read LoadingColor write LoadingColor; deprecated 'use LoadingColor'; |
|
Warning: this symbol is deprecated: use LoadingColor This item has no description. |
property LoadingImageForWindowHeight: Single
read LoadingUIReferenceHeight write LoadingUIReferenceHeight; deprecated 'use LoadingUIReferenceHeight'; |
|
Warning: this symbol is deprecated: use LoadingUIReferenceHeight This item has no description. |
Generated by PasDoc 0.16.0-snapshot.