Castle Game EngineIntroduction Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers
|
Class TUIControlFont
Unit
CastleControls
Declaration
type TUIControlFont = class(TUIControl)
Description
Base class for all user interface controls using a font. Allows to customize font and font size per-control, or use defaults.
Hierarchy
Overview
Methods
Properties
 |
property OutlineColor: TCastleColor read FOutlineColor write SetOutlineColor; |
 |
property Tooltip: string read FTooltip write FTooltip; |
 |
property CustomFont: TCastleFont
read FCustomFont write SetCustomFont; |
 |
property OwnsCustomFont: boolean
read FOwnsCustomFont write FOwnsCustomFont default false; deprecated 'use TCastleFont (inherited from TComponent) owner mechanism'; |
 |
property FontSize: Single read FFontSize write SetFontSize default 0.0; |
 |
property SmallFont: boolean read FSmallFont write SetSmallFont default false; |
 |
property Outline: Cardinal read FOutline write SetOutline default 0; |
 |
property OutlineHighQuality: boolean
read FOutlineHighQuality write SetOutlineHighQuality default false; |
Description
Methods
 |
procedure UIScaleChanged; override; |
|
|
 |
procedure Notification(AComponent: TComponent; Operation: TOperation); override; |
|
|
 |
destructor Destroy; override; |
|
|
 |
procedure GLContextClose; override; |
|
|
 |
function TooltipExists: boolean; override; |
|
|
 |
procedure TooltipRender; override; |
|
|
 |
procedure Render; override; |
|
|
 |
procedure CheckFontChanged; |
|
Check does currently used font (see Font) changed, and eventually call FontChanged method now.
You only need to explicitly call this in very specific circumstances, when you just changed UIFont or UIFontSmall (as changing CustomFont automatically immediately calls this) and you want control size to be updated immediately (for example, you need TCastleButton.Height to be immediately valid). Without calling this, it could be updated only at next Render call.
|
 |
procedure FontChanged; virtual; |
|
Force considering font changed (font instance, or glyphs, or sizes changed).
Usually, you don't need to call this explicitly from the outside. Changing font, like UIFont or UIFontSmall or CustomFont or any property that may affect the font is automatically applied.
But there are exceptions: right now, if you call Load on a font, it's measurements will change but some controls using it will not recalculate sizes automatically. In this case, call this method.
|
Properties
 |
property OutlineColor: TCastleColor read FOutlineColor write SetOutlineColor; |
|
Outline color, used only if Outline <> 0. Default is black.
See also
- Outline
- Outline size around the font.
|
 |
property CustomFont: TCastleFont
read FCustomFont write SetCustomFont; |
|
When non-nil, this font will be used to draw this control. Otherwise the global UIFont or UIFontSmall (depending on SmallFont) will be used.
|
 |
property OwnsCustomFont: boolean
read FOwnsCustomFont write FOwnsCustomFont default false; deprecated 'use TCastleFont (inherited from TComponent) owner mechanism'; |
|
Warning: this symbol is deprecated: use TCastleFont (inherited from TComponent) owner mechanism |
 |
property FontSize: Single read FFontSize write SetFontSize default 0.0; |
|
Use given font size when drawing. Leave at default zero to use the default size of the font (may still be scaled by TUIControl.UIScale, but this happens only if TUIContainer.UIScaling is set to something else than default usNone). Font itself is taken from CustomFont or, if not set, from UIFont or UIFontSmall.
|
 |
property SmallFont: boolean read FSmallFont write SetSmallFont default false; |
|
Use smaller font. If no CustomFont is assigned, this says to use UIFontSmall instead of UIFont. If CustomFont is assigned, this says to scale it's size by 2.
|
 |
property Outline: Cardinal read FOutline write SetOutline default 0; |
|
Outline size around the font. Note that the current implementation is very simple, it will only look sensible for small outline values (like 1 or 2).
See TCastleFont.Outline for more details.
Specifying a non-zero outline for a label overrides the default outline settings for the current font. By default, fonts do not have an outline.
See also
- OutlineHighQuality
- Optionally force better outline quality.
|
 |
property OutlineHighQuality: boolean
read FOutlineHighQuality write SetOutlineHighQuality default false; |
|
Optionally force better outline quality. Used only if Outline <> 0. High quality outline looks better, but is about 2x more expensive to draw.
See also
- Outline
- Outline size around the font.
|
Generated by PasDoc 0.14.0.
|