Class TCastleText
Unit
Declaration
type TCastleText = class(TCastleAbstractPrimitive)
Description
Text that is displayed and transformed as TCastleTransform, inside TCastleViewport, and can be manipulated in 3D.
See manual about displaying text and fonts. See manual about TCastleText in a viewport.
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleComponent
- TCastleTransform
- TCastleAbstractPrimitive
- TCastleText
Overview
Methods
procedure TranslateProperties(const TranslatePropertyEvent: TTranslatePropertyEvent); override; |
|
function GetInternalText: String; override; |
|
procedure SetInternalText(const Value: String); override; |
|
constructor Create(AOwner: TComponent); override; |
|
destructor Destroy; override; |
|
function PropertySections(const PropertyName: String): TPropertySections; override; |
Properties
property Caption: String read GetCaption write SetCaption stored false; |
|
property Text: TStrings read FText write SetText; |
|
property CaptionTranslate: Boolean read FCaptionTranslate write FCaptionTranslate default true; |
|
property Material default pmUnlit; |
|
property DoubleSided: Boolean read FDoubleSided write SetDoubleSided default true; |
|
property Alignment: THorizontalPosition
read FAlignment write SetAlignment default hpLeft; |
|
property VerticalAlignment: TVerticalPosition
read FVerticalAlignment write SetVerticalAlignment default vpBottom; |
|
property Size: Single read FSize write SetSize default 1.0; |
|
property Spacing: Single read FSpacing write SetSpacing default 1.0; |
|
property CustomFont: TCastleFont read FCustomFont write SetCustomFont; |
Description
Methods
procedure TranslateProperties(const TranslatePropertyEvent: TTranslatePropertyEvent); override; |
|
This item has no description. Showing description inherited from TCastleComponent.TranslateProperties. Enumerate all properties that are possible to translate in this component. E.g. in TCastleLabel it will return TCastleLabel.Caption, in TCastleEdit it will return TCastleEdit.Text and TCastleEdit.Placeholder. Returns only non-empty properties, thus assuming that if current (by convention, English) text is empty, then there is no point in translating it. Moreover descendants may define boolean properties to exclude particular text from translating, e.g. TCastleLabel.CaptionTranslate, TCastleEdit.TextTranslate, TCastleEdit.PlaceholderTranslate. It is not recursive (it doesn't enumerate children properties). Use global TranslateProperties procedure to call this on a hierarchy of TComponent. You usually don't want to call this method (it is called by other engine routines). But you may find it useful to override this, if you define new component. |
function GetInternalText: String; override; |
|
This item has no description. |
procedure SetInternalText(const Value: String); override; |
|
This item has no description. |
constructor Create(AOwner: TComponent); override; |
|
This item has no description. |
destructor Destroy; override; |
|
This item has no description. |
function PropertySections(const PropertyName: String): TPropertySections; override; |
|
This item has no description. Showing description inherited from TCastleComponent.PropertySections. Section where to show property in the editor. |
Properties
property Caption: String read GetCaption write SetCaption stored false; |
|
Text displayed, expressed by a simple String. This is just a shortcut to get/set Text as a single String. Use LineEnding or NL constant when setting this to indicate a newline. The two examples below are equivalent: // one way MyText.Text.Clear; MyText.Text.Add('First line'); MyText.Text.Add('Second line'); // alternative way to do the same MyText.Caption := 'First line' + LineEnding + 'Second line'; |
property Text: TStrings read FText write SetText; |
|
Text displayed, with each line as a separate String. Setting this property merely copies the contents using TStrings.Assign. |
property CaptionTranslate: Boolean read FCaptionTranslate write FCaptionTranslate default true; |
|
Should the Caption be localized (translated into other languages). Determines if the property is enumerated by TCastleComponent.TranslateProperties, which affects the rest of localization routines. |
property Material default pmUnlit; |
|
Text is by default unlit. |
property DoubleSided: Boolean read FDoubleSided write SetDoubleSided default true; |
|
When this is Note that the default for TCastleText is different than the default for most other primitives, like TCastleBox and TCastleSphere: by default text is double-sided, while most other primitives by default are not double-sided. Set this property to |
property Alignment: THorizontalPosition
read FAlignment write SetAlignment default hpLeft; |
|
Horizontal alignment of the text. |
property VerticalAlignment: TVerticalPosition
read FVerticalAlignment write SetVerticalAlignment default vpBottom; |
|
Vertical alignment of the text. |
property Size: Single read FSize write SetSize default 1.0; |
|
Size of the text, given as height of a single line of text. See https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD/Part01/components/text.html#FontStyle for an illustrative image. |
property Spacing: Single read FSpacing write SetSpacing default 1.0; |
|
Spacing between lines of text, to make lines more distant (with values > 1) or more squeezed (with values < 1). See https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD/Part01/components/text.html#FontStyle for an illustrative image. |
property CustomFont: TCastleFont read FCustomFont write SetCustomFont; |
|
Adjust the font. |
Generated by PasDoc 0.16.0-snapshot.