Unit CastleUIControls

Description

User interface basic classes: TCastleUserInterface, TUIContainer.

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
Object TTouch Tracking of a touch by a single finger, used by TTouchList.
Class TTouchList Tracking of multi-touch, a position of each finger on the screen.
Class TUIContainer Abstract user interface container.
Class TBorder Configurable border size for TCastleUserInterface.Border.
Class TInputListener Base class for things that listen to user input.
Class TCastleUserInterface Basic user-interface class.
Class TCastleUserInterfaceList Simple list of TCastleUserInterface instances.
Class TChildrenControls List of UI controls, with a parent control and container.

Functions and Procedures

function OnGLContextOpen: TGLContextEventList; deprecated 'use ApplicationProperties.OnGLContextOpen';
function OnGLContextClose: TGLContextEventList; deprecated 'use ApplicationProperties.OnGLContextClose';
function IsGLContextOpen: boolean; deprecated 'use ApplicationProperties.IsGLContextOpen';
function RenderControlToImage(const Container: TUIContainer; const Control: TCastleUserInterface; const ViewportRect: TRectangle; const BackgroundColor: TCastleColor): TRGBAlphaImage; overload;

Types

TContainerEvent = procedure (Container: TUIContainer);
TContainerObjectEvent = procedure (Container: TUIContainer) of object;
TInputPressReleaseEvent = procedure (Container: TUIContainer; const Event: TInputPressRelease);
TInputMotionEvent = procedure (Container: TUIContainer; const Event: TInputMotion);
TUiNotifyEvent = procedure (const Sender: TCastleUserInterface) of object;
TUiUpdateEvent = procedure (const Sender: TInputListener; const SecondsPassed: Single; var HandleInput: Boolean) of object;
TUiPressReleaseEvent = procedure (const Sender: TInputListener; const Event: TInputPressRelease; var Handled: Boolean) of object;
TUiMotionEvent = procedure (const Sender: TInputListener; const Event: TInputMotion; var Handled: Boolean) of object;
PTouch = ˆTTouch;
TUIScaling = (...);
TCastleUserInterfaceChange = (...);
TCastleUserInterfaceChanges = set of TCastleUserInterfaceChange;
TCastleUserInterfaceChangeEvent = procedure(const Sender: TInputListener; const Changes: TCastleUserInterfaceChanges; const ChangeInitiatedByChildren: boolean) of object;
TPositionRelative = (...) deprecated;
TCastleUserInterfaceClass = class of TCastleUserInterface;
TUIControlPos = TCastleUserInterface deprecated 'use TCastleUserInterface';
TUIRectangularControl = TCastleUserInterface deprecated 'use TCastleUserInterface';
TUIControl = TCastleUserInterface deprecated 'use TCastleUserInterface';
TUIControlSizeable = TCastleUserInterface deprecated 'use TCastleUserInterface';
TCastleUserInterfaceRect = TCastleUserInterface deprecated 'use TCastleUserInterface';
TUIControlChange = TCastleUserInterfaceChange;
TUIControlChanges = TCastleUserInterfaceChanges;
TUIControlList = TCastleUserInterfaceList;
TUIControlChangeEvent = TCastleUserInterfaceChangeEvent;

Constants

DefaultDpi = 96.0;
DefaultTooltipDelay = 1.0;
DefaultTooltipDistance = 10;
prLeft = prLow deprecated;
prRight = prHigh deprecated;
prBottom = prLow deprecated;
prTop = prHigh deprecated;
hpLeft = CastleRectangles.hpLeft ;
hpMiddle = CastleRectangles.hpMiddle;
hpRight = CastleRectangles.hpRight ;
vpBottom = CastleRectangles.vpBottom;
vpMiddle = CastleRectangles.vpMiddle;
vpTop = CastleRectangles.vpTop ;

Variables

CastleDesignMode: Boolean;

Description

Functions and Procedures

function OnGLContextOpen: TGLContextEventList; deprecated 'use ApplicationProperties.OnGLContextOpen';

Warning: this symbol is deprecated: use ApplicationProperties.OnGLContextOpen

 
function OnGLContextClose: TGLContextEventList; deprecated 'use ApplicationProperties.OnGLContextClose';

Warning: this symbol is deprecated: use ApplicationProperties.OnGLContextClose

 
function IsGLContextOpen: boolean; deprecated 'use ApplicationProperties.IsGLContextOpen';

Warning: this symbol is deprecated: use ApplicationProperties.IsGLContextOpen

 
function RenderControlToImage(const Container: TUIContainer; const Control: TCastleUserInterface; const ViewportRect: TRectangle; const BackgroundColor: TCastleColor): TRGBAlphaImage; overload;

Render control contents to an RGBA image, using off-screen rendering. The background behind the control is filled with BackgroundColor (which may be transparent, e.g. with alpha = 0).

The rendering is done using off-screen FBO. Which means that you can request any size, you are not limited to your current window / control size.

Make sure that the control is nicely positioned to fill the ViewportRect. Usually you want to adjust control size and position, and disable UI scaling (set TCastleUserInterface.EnableUIScaling = False if you use TUIContainer.UIScaling).

This is the easiest way to make off-screen rendering, i.e. to render 3D things (like TCastleScene or TCastleSceneManager) into an image. This is not the fastest way, as it creates new TGLRenderToTexture instance each time, and it grabs the image contents to CPU. If you want a faster approach, use TUIContainer.RenderControl and render into TGLImage using TGLImage.RenderToImageBegin and TGLImage.RenderToImageEnd.

Types

TContainerEvent = procedure (Container: TUIContainer);
 
TContainerObjectEvent = procedure (Container: TUIContainer) of object;
 
TInputPressReleaseEvent = procedure (Container: TUIContainer; const Event: TInputPressRelease);
 
TInputMotionEvent = procedure (Container: TUIContainer; const Event: TInputMotion);
 
TUiNotifyEvent = procedure (const Sender: TCastleUserInterface) of object;
 
TUiUpdateEvent = procedure (const Sender: TInputListener; const SecondsPassed: Single; var HandleInput: Boolean) of object;
 
TUiPressReleaseEvent = procedure (const Sender: TInputListener; const Event: TInputPressRelease; var Handled: Boolean) of object;
 
TUiMotionEvent = procedure (const Sender: TInputListener; const Event: TInputMotion; var Handled: Boolean) of object;
 
PTouch = ˆTTouch;
 
TUIScaling = (...);

Possible values for TUIContainer.UIScaling.

Values
TCastleUserInterfaceChange = (...);

Things that can cause TInputListener.VisibleChange notification.

Values
  • chRender: The look of this control changed. This concerns all the things that affect what TCastleUserInterface.Render does.

    Note that changing chRectangle implies that the look changed too. So when chRectangle is in Changes, you should always behave like chRender is also in Changes, regardless if it's there or not.

  • chRectangle: The rectangle (size or position) of the control changed. This concerns all the things that affect TCastleUserInterface.Rect or our position inside parent (anchors).

    Note that this is not (necessarily) called when the screen position changed just because the parent screen position changed. We only notify when the size or position changed with respect to the parent.

    Note that changing chRectangle implies that the look changed too. So when chRectangle is in Changes, you should always behave like chRender is also in Changes, regardless if it's there or not.

  • chCursor
  • chCamera: Used by TCamera descendants to notify that the current camera view (position, direction, up and everything related to it) changed.
  • chExists
  • chChildren: A child control was added or removed.
TCastleUserInterfaceChanges = set of TCastleUserInterfaceChange;
 
TCastleUserInterfaceChangeEvent = procedure(const Sender: TInputListener; const Changes: TCastleUserInterfaceChanges; const ChangeInitiatedByChildren: boolean) of object;
 
TPositionRelative = (...) deprecated;

Warning: this symbol is deprecated.

Position for relative layout of one control in respect to another. Deprecated, rather use cleaner THorizontalPosition and TVerticalPosition.

Values
  • prLow
  • prMiddle
  • prHigh
TCastleUserInterfaceClass = class of TCastleUserInterface;
 
TUIControlPos = TCastleUserInterface deprecated 'use TCastleUserInterface';

Warning: this symbol is deprecated: use TCastleUserInterface

 
TUIRectangularControl = TCastleUserInterface deprecated 'use TCastleUserInterface';

Warning: this symbol is deprecated: use TCastleUserInterface

 
TUIControl = TCastleUserInterface deprecated 'use TCastleUserInterface';

Warning: this symbol is deprecated: use TCastleUserInterface

 
TUIControlSizeable = TCastleUserInterface deprecated 'use TCastleUserInterface';

Warning: this symbol is deprecated: use TCastleUserInterface

 
TCastleUserInterfaceRect = TCastleUserInterface deprecated 'use TCastleUserInterface';

Warning: this symbol is deprecated: use TCastleUserInterface

 
TUIControlChange = TCastleUserInterfaceChange;
 
TUIControlChanges = TCastleUserInterfaceChanges;
 
TUIControlList = TCastleUserInterfaceList;
 
TUIControlChangeEvent = TCastleUserInterfaceChangeEvent;
 

Constants

DefaultDpi = 96.0;

Default value for container's Dpi, as is usually set on desktops.

DefaultTooltipDelay = 1.0;
 
DefaultTooltipDistance = 10;
 
prLeft = prLow deprecated;

Warning: this symbol is deprecated.

 
prRight = prHigh deprecated;

Warning: this symbol is deprecated.

 
prBottom = prLow deprecated;

Warning: this symbol is deprecated.

 
prTop = prHigh deprecated;

Warning: this symbol is deprecated.

 
hpLeft = CastleRectangles.hpLeft ;
 
hpMiddle = CastleRectangles.hpMiddle;
 
hpRight = CastleRectangles.hpRight ;
 
vpBottom = CastleRectangles.vpBottom;
 
vpMiddle = CastleRectangles.vpMiddle;
 
vpTop = CastleRectangles.vpTop ;
 

Variables

CastleDesignMode: Boolean;

Are we inside Castle Game Engine designer mode.


Generated by PasDoc 0.15.0.