Unit CastleControls

Description

Standard 2D controls: buttons, labels, sliders etc.

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
Class TCastleUserInterfaceFont Base class for all user interface controls using a font.
Class TCastleButton Clickable button.
Class TCastlePanel Panel or a toolbar control.
Class TCastleImageControl Image control.
Class TCastleTouchControl Touch user interface to navigate in a 3D world.
Class TCastleRectangleControl Fill a rectangle on screen with given color or theme image.
Class TCastleShape Draw a simple shape (rectangle, circle) with given color and optional outline.
Class TCastleSimpleBackground Fill the whole window with a simple color.
Class TCastleLabel Label with possibly multiline text, in an optional box.
Class TCastleCrosshair Display a simple crosshair in the middle of the parent control.
Class TCastleProgressBar Progress bar user interface.
Class TCastleAbstractSlider An abstract slider user interface.
Class TCastleFloatSlider Slider to change a float value within a given range.
Class TCastleIntegerSlider Slider to change an integer value within a given range.
Class TCastleScrollViewCustom Abstract user interface with a scrollbar.
Class TCastleScrollView Container for a user interface children that can be scrolled vertically.
Class TCastleScrollViewManual Control with a scrollbar.
Class TCastleSwitchControl Touch-friendly checkbox control with representing on/off state.
Class TCastleCheckbox Checkbox with a caption.
Class TCastleTableViewCell Cell inside TCastleTableView.
Interface ICastleTableViewDataSource Data source used in TCastleTableView.
Class TCastleTableView TableView control to show lists in GUI.
Class TCastleTimer Timer, running the OnTimer event periodically.
Class TCastleEdit Edit box to input a single line of text.
Class TCastleFloatEdit Descendant of TCastleEdit specialized for editing floating-point numbers.
Class TCastleIntegerEdit Descendant of TCastleEdit specialized for editing integer numbers.
Class TCastlePackedGroup Abstract ancestor for containers that pack children, like TCastleHorizontalGroup and TCastleVerticalGroup.
Class TCastleHorizontalGroup Container that packs the children horizontally.
Class TCastleVerticalGroup Container that packs the children vertically.
Class TCastleDesign Contents of this user-interface control are loaded from an indicated file (by the URL property).
Class TCastleClipboard Clipboard to cut / copy / paste the text.

Functions and Procedures

function GetUIFont: TCastleAbstractFont;
procedure SetUIFont(const Value: TCastleAbstractFont);
function GetUIFontSmall: TCastleAbstractFont; deprecated 'use any other font (like UIFont or Container.DefaultFont) and just set smaller size (e.g. by TCastleLabel.FontSize)';
procedure SetUIFontSmall(const Value: TCastleAbstractFont); deprecated 'use any other font (like UIFont or Container.DefaultFont) and just set smaller size (e.g. by TCastleLabel.FontSize)';
function FallbackFont: TCastleFont;
procedure ForceFallbackLook(const Ui: TCastleUserInterface);
function Clipboard: TCastleClipboard;
procedure RegisterClipboard(const AClipboard: TCastleClipboard);

Types

TUIControlFont = TCastleUserInterfaceFont deprecated 'use TCastleUserInterfaceFont';
TCastleButtonImageLayout = (...);
TProportionalScaling = (...);
TCastleTouchCtlMode = (...);
TCastleTouchPosition = (...);
TShapeType = (...);
TCastleCrosshairShape = (...);
TCastleTableViewCellAccessoryType = (...);
TCastleTableViewCellList = specialize TObjectList<TCastleTableViewCell>;
TTableViewDidSelectCellEvent = procedure(Row: Integer; Sender: TCastleTableView) of object;

Variables

property UIFont: TCastleAbstractFont read GetUIFont write SetUIFont;
property UIFontSmall: TCastleAbstractFont read GetUIFontSmall write SetUIFontSmall;

Description

Functions and Procedures

function GetUIFont: TCastleAbstractFont;
 
procedure SetUIFont(const Value: TCastleAbstractFont);
 
function GetUIFontSmall: TCastleAbstractFont; deprecated 'use any other font (like UIFont or Container.DefaultFont) and just set smaller size (e.g. by TCastleLabel.FontSize)';

Warning: this symbol is deprecated: use any other font (like UIFont or Container.DefaultFont) and just set smaller size (e.g. by TCastleLabel.FontSize)

 
procedure SetUIFontSmall(const Value: TCastleAbstractFont); deprecated 'use any other font (like UIFont or Container.DefaultFont) and just set smaller size (e.g. by TCastleLabel.FontSize)';

Warning: this symbol is deprecated: use any other font (like UIFont or Container.DefaultFont) and just set smaller size (e.g. by TCastleLabel.FontSize)

 
function FallbackFont: TCastleFont;

The default font, used throughout the engine as a fallback. This is a modern sans-serif font hardcoded into the engine.

procedure ForceFallbackLook(const Ui: TCastleUserInterface);

Force using FallbackFont (thus, ignore TCastleContainer.DefaultFont) and FallbackTheme (thus, disable any Theme customizations) in this UI. This guarantees the same UI look, ignoring user's UI font and theme customizations.

function Clipboard: TCastleClipboard;

Single global instance of TCastleClipboard. Automatically created / destroyed by this unit.

procedure RegisterClipboard(const AClipboard: TCastleClipboard);

Register custom TCastleClipboard implementation, that replaces the global Clipboard. The instance given here becomes owned by this unit (we will free it automatically).

Types

TUIControlFont = TCastleUserInterfaceFont deprecated 'use TCastleUserInterfaceFont';

Warning: this symbol is deprecated: use TCastleUserInterfaceFont

 
TCastleButtonImageLayout = (...);

Possible image placement for a button, see TCastleButton.ImageLayout.

Values
  • ilTop
  • ilBottom
  • ilLeft
  • ilRight
TProportionalScaling = (...);

Indicate stretching approach for TCastleImageControl.ProportionalScaling.

Values
  • psNone: Adjust to the requested area, ignoring proportions.
  • psEnclose: Adjust to the requested area, honoring proportions, such that the image may be larger than the requested area.
  • psFit: Adjust to the requested area, honoring proportions, such that the image may be smaller than the requested area.
TCastleTouchCtlMode = (...);

Possible touch control UI, for TCastleTouchControl.TouchMode.

Values
  • ctcmWalking
  • ctcmWalkWithSideRot
  • ctcmHeadRotation
  • ctcmFlyUpdown
  • ctcmPanXY
TCastleTouchPosition = (...);
 
Values
  • tpManual
  • tpLeft
  • tpRight
TShapeType = (...);

Possible shape type, for TCastleShape.ShapeType.

Values
  • stRectangle
  • stCircle
  • stTriangleUp
  • stTriangleDown
  • stTriangleRight
  • stTriangleLeft
TCastleCrosshairShape = (...);

Possible crosshair shape, for TCastleCrosshair.Shape.

Values
  • csCross
  • csCrossRect
TCastleTableViewCellAccessoryType = (...);

Decoration used in TCastleTableViewCell.

Values
  • tvcaNone
  • tvcaCheckmark
  • tvcaDisclosureIndicator
TCastleTableViewCellList = specialize TObjectList<TCastleTableViewCell>;
 
TTableViewDidSelectCellEvent = procedure(Row: Integer; Sender: TCastleTableView) of object;
 

Variables

property UIFont: TCastleAbstractFont read GetUIFont write SetUIFont;

The default font, used throughout the engine as a fallback. By default, this is a modern sans-serif font hardcoded into the engine.

You can assign your own font here, to make this the new default font.

Although in most cases it is better to leave UIFont unchanged (treat it like "engine default font"), and instead set your default font by setting Window.Container.DefaultFont. You can do it by code, or by editing CastleSettings.xml (this way editor will be aware of this new default), see https://castle-engine.io/manual_castle_settings.php .

Note that assigning font here does not make it automatically freed. Use the ownership mechanism to make sure it is freed, i.e. assign some owner to your font instance, like this:

MyFont := TCastleFont.Create({ owner } Application);
MyFont.Load(TextureFont_Xxxx);
UIFont := MyFont;

property UIFontSmall: TCastleAbstractFont read GetUIFontSmall write SetUIFontSmall;
 

Generated by PasDoc 0.16.0.