Castle Game EngineIntroduction Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers
|
Class TCastleTheme
Unit
CastleControls
Declaration
type TCastleTheme = class(TObject)
Description
Theme for 2D GUI controls. Should only be used through the single global instance Theme.
Hierarchy
Overview
Fields
Methods
Properties
Description
Fields
 |
LoadingBackgroundColor: TCastleColor; |
|
Colors used when displaying the "Loading..." text when Android application is resuming. Note that you can also customize the tiLoading image. By default, LoadingBackgroundColor is black, and LoadingTextColor is white.
|
 |
LoadingTextColor: TCastleColor; |
|
Colors used when displaying the "Loading..." text when Android application is resuming. Note that you can also customize the tiLoading image. By default, LoadingBackgroundColor is black, and LoadingTextColor is white.
|
Methods
 |
constructor Create; |
|
|
 |
destructor Destroy; override; |
|
|
 |
procedure Draw(const Rect: TRectangle; const ImageType: TThemeImage; const UIScale: Single = 1.0); |
|
Draw the selected theme image on screen.
Parameters
- Color
- Color tint of the image. If you do not specify a color, white will be used, so image will be displayed as-is. Specifying a color means that image will be multiplied by it, just like for TGLImageCore.Color.
- UIScale
- Used to properly scale corners, passed to TGLImageCore.ScaleCorners. This parameter does not scale the place where image is displayed, to do this just scale the given Rect parameter yourself.
|
 |
procedure DialogsLight; |
|
Set dialogs theme to light.
|
Properties
 |
property MessageErrorBackground: boolean
read FMessageErrorBackground write FMessageErrorBackground default false; |
|
Undernath various message dialogs show "error background" (tiErrorBackground) image instead of the default behaviour. This is automatically used by CastleWindow exception handler, you should not need to modify this property yourself.
This affects modal messages made by CastleMessages unit, and modal messages made by TCastleWindowCustom.MessageOK and friends, or modal states by TGLModeFrozenScreen.
The default behaviour of them is to show the TCastleDialog provided background (coming from screenshot usually), in case of CastleMessages it is mixed with BackgroundTint. But saving the screen is potentially a bad idea when an exception occured (since the application may be already in some dirty state, for which the developer is not necessarily prepared).
|
 |
property Images[constImageType:TThemeImage]: TCastleImage read GetImages write SetImages; |
|
2D GUI 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 TGLImageCore).
|
 |
property OwnsImages[constImageType:TThemeImage]: boolean read GetOwnsImages write SetOwnsImages; |
|
|
 |
property Corners[constImageType:TThemeImage]: TVector4Integer read GetCorners write SetCorners; |
|
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 TGLImageCore.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: TCastleFont read FMessageFont write SetMessageFont; |
|
Font used by dialogs. Leave Nil to use UIFont.
|
 |
property OwnsMessageFont: boolean
read FOwnsMessageFont write FOwnsMessageFont default true; |
|
|
Generated by PasDoc 0.14.0.
|