New and improved user interface controls:
-
New TCastleCheckbox shows a standard checkbox with a caption. It supports the standard properties and events, like
Checked
,Caption
,OnChange
and so on.I also recommend TCastleCheckbox implementation as a demo of implementing a component by composing some other internal components. In this case,
TCastleCheckbox
is realized as 2xTCastleImageControl
andTCastleLabel
instances. This is much easier and more powerful than drawing everything in the componentRender
method yourself. -
A new UI control TCastleDesign allows to reference a
xxx.castle-user-interface
file. This is especially useful inside the editor, to visually see onexxx.castle-user-interface
file embedded inside anotheryyy.castle-user-interface
.From code, it is usually more straightforward to load designs using UserInterfaceLoad global function, than to use TCastleDesign.
-
TCastleLabel is now by default black. This makes it consistent with other UI controls (that generally assume “dark text over light background”), and avoids a confusion when default
TCastleLabel
isn’t visible over defaultTCastleRectangleColor
(as they were both pure white, in previous engine version).On a related note, TCastleSceneManager no longer has pure black background, it has very dark gray (0.1, 0.1, 0.1, 1) background. This way pure black things are clearly visible over it. See Upgrading to Castle Game Engine 6.6 for detailed reasoning.
-
TCastleScrollView received a number of fixes.
-
TCastleVerticalGroup and TCastleHorizontalGroup have now configurable
AutoSize
and by default zeroPadding
andSpacing
(more intuitive). -
You can now activate TCastleImageControl.DetectScaleFromUrl. This affects how the auto-scaling works, and detects special filenames like
[email protected]
. If you load an image file called[email protected]
with size 20×20, and setDetectScaleFromUrl
totrue
, then the automatically calculated control size will be 10×10 (2x smaller than the actual image size).This is a very useful trick to provide “upscaled” images that work with any UI scaling.
-
TCastleButton.CustomColorXxx allows to configure button look by a solid color.
-
The TCastleEdit has a number of new features:
- Placeholder text with PlaceholderColor
- PasswordChar to present password-input fields,
- OnChange event, AutoSize property.