Castle Game EngineIntroduction Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers
|
Unit CastleControls
Description
Standard 2D controls: buttons, labels, sliders etc.
Uses
Overview
Classes, Interfaces, Objects and Records
Functions and Procedures
Types
Variables
Description
Functions and Procedures
function GetUIFont: TCastleFont; |
|
The 2D fonts used throughout UI interface.
By default, this is a modern sans-serif font hardcoded into the engine. It will be automatically created and freed if needed. This is comfortable for simple applications, you can just start "drawing text" without initializing anything.
You can assign your own font here, to make this the default font used by all 2D controls.
Note that assigning font here does not make it automatically freed (this would cause more trouble than comfort). To make sure your own fonts are always freed, set the font "owner" at creation, e.g. the example below sets the Application as owner:
MyFont := TTextureFont.Create(Application);
MyFont.Load(TextureFont_Xxxx);
UIFont := MyFont;
|
function GetUIFontSmall: TCastleFont; deprecated 'use UIFont and temporarily change the size to be smaller, or use TUIControlFont.SmallFont'; |
|
Warning: this symbol is deprecated: use UIFont and temporarily change the size to be smaller, or use TUIControlFont.SmallFont |
procedure SetUIFontSmall(const Value: TCastleFont); deprecated 'use UIFont and temporarily change the size to be smaller, or use TUIControlFont.SmallFont'; |
|
Warning: this symbol is deprecated: use UIFont and temporarily change the size to be smaller, or use TUIControlFont.SmallFont |
Types
TThemeImage = (...); |
Values
-
tiPanel:
-
tiPanelSeparator:
-
tiProgressBar:
-
tiProgressFill:
-
tiButtonPressed:
-
tiButtonDisabled:
-
tiButtonFocused:
-
tiButtonNormal:
-
tiWindow:
-
tiScrollbarFrame:
-
tiScrollbarSlider:
-
tiSlider:
-
tiSliderPosition:
-
tiLabel:
-
tiActiveFrame:
-
tiTooltip:
-
tiTouchCtlInner:
-
tiTouchCtlOuter:
-
tiTouchCtlFlyInner:
-
tiTouchCtlFlyOuter:
-
tiCrosshair1:
-
tiCrosshair2:
-
tiErrorBackground:
-
tiLoading: Image displayed when the application is initializing, during Application.OnInitialize and Window.OnOpen. And TUIControl.GLContextOpen for all initially present UI controls. This "loading image" is loaded and displayed first, so that user does not see a black screen while the resources are prepared.
It is especially useful on Android, where we can lose the OpenGL context at any moment, as user may switch applications in the middle of the game. When getting back to the application, we need to initiailize some resources, and during this process we also show this image. So this serves as a universal "please wait, we're loading" screen.
You can customize this image, by setting Theme.Images[tiLoading], LoadingBackgroundColor, LoadingTextColor. See http://castle-engine.sourceforge.net/tutorial_player_2d_controls.php for a sample code that sets a theme image.
Note that the customization of this image should be done before Application.OnInitialize has started, so it has to be usually done from the "initialization" section of some unit. And in the "initialization" section of a unit, you cannot load files (doing LoadImage at this point may fail on some Android devices, as we cannot load assets before activity is started). So you can only assign images already available in code — use image-to-pascal tool to convert any image to a Pascal code for this purpose.
-
tiEdit: TCastleEdit frame.
|
TCastleButtonImageLayout = (...); |
|
Copyright 2010-2017 Michalis Kamburelis.
This file is part of "Castle Game Engine".
"Castle Game Engine" is free software; see the file COPYING.txt, included in this distribution, for details about the copyright.
"Castle Game Engine" is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
—————————————————————————-
Values
-
ilTop:
-
ilBottom:
-
ilLeft:
-
ilRight:
|
TCastleTouchCtlMode = (...); |
|
Copyright 2010-2017 Michalis Kamburelis.
This file is part of "Castle Game Engine".
"Castle Game Engine" is free software; see the file COPYING.txt, included in this distribution, for details about the copyright.
"Castle Game Engine" is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
—————————————————————————-
Values
-
ctcmWalking:
-
ctcmWalkWithSideRot:
-
ctcmHeadRotation:
-
ctcmFlyUpdown:
-
ctcmPanXY:
|
TCastleTouchPosition = (...); |
Values
-
tpManual:
-
tpLeft:
-
tpRight:
|
TShapeType = (...); |
|
Copyright 2010-2017 Michalis Kamburelis.
This file is part of "Castle Game Engine".
"Castle Game Engine" is free software; see the file COPYING.txt, included in this distribution, for details about the copyright.
"Castle Game Engine" is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
—————————————————————————-
Values
|
TCastleCrosshairShape = (...); |
|
Copyright 2010-2017 Michalis Kamburelis.
This file is part of "Castle Game Engine".
"Castle Game Engine" is free software; see the file COPYING.txt, included in this distribution, for details about the copyright.
"Castle Game Engine" is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
—————————————————————————-
Values
|
Variables
Generated by PasDoc 0.14.0.
|