The editor supports selecting, translating and resizing UI controls (possibly with snap). You may have already seen it in the movie.
It is possible to use custom components within the editor.
New build tool command “castle-engine editor” will run Castle Game Engine Editor within the current project, with possible project-specific components. It will automatically build CGE editor with additional project-specific components included.
See the editor README, section “Include custom (project-specific) components in the visual designer”.
The editor has menu items to adjust camera (Scene Manager Camera View All), and to reorder 2D scenes (Scene Manager Sort For Correct 2D Blending).
Much more vectors and colors are editable and persistent in the editor. E.g.
The user interface coordinates (all positions, sizes) are float-based now. In other words, TCastleUserInterface.Width, TCastleUserInterface.Height, and a lot of “friends” now have a type Single, not Integer. In some cases, we deprecated old integer-based property (like TCastleUserInterface.CalculatedWidth, TCastleUserInterface.ScreenRect) and added a new float-based replacement (like TCastleUserInterface.EffectiveWidth, TCastleUserInterface.RenderRect).
Note: This change may break backward compatibility in some cases. You may need to adjust your code. This was unfortunately unavoidable, the API looked really messy when I was trying to maintain 100% backward compatibility (having both integer-based and float-based methods and properties). Details in this commit log.
If you just did
MyControl.Width := 100it will work as before. But if you did e.g.
MyInteger := MyControl.Width, or
MyInteger := MyControl.Width div 2, it will no longer work, as
Widthis a floating-point value (Single) now. You will need to adjust your code. You can just write
Round(MyControl.Width), or you can adjust your code to use float-based coordinates everywhere too.
If you use rectangles, you can convert between integer-based (
TRectangle) and float-based (
MyFloatRectangle := FloatRectangle(MyIntRectangle)or
MyIntRectangle := MyFloatRectangle.Round;.
If you encounter troubles adjusting your code, please let us know on Discord or forums, we will help!
TCastleUserInterfacenow has a size (Width, Height, FullSize properties). The
TUIControlRectare all now just deprecated aliases for
All UI controls have non-zero size by default. The base
TCastleUserInterfaceclass sets width and height to 100. This is more friendly (especially when using the editor) than previous situation when
TUIControlRecthad by default zero size.
Thanks to Alexander Skvortsov and Yevhen Loza, the complete book “Modern Object Pascal Introduction for Programmers” is now available in Russian. Read it here in the Russian version:
- HTML version – “Modern Object Pascal Introduction for Programmers” in Russian
- PDF version – “Modern Object Pascal Introduction for Programmers” in Russian
My many thanks go to the translators for the huge task they did. The translation includes the complete text, comments in the example code, and they also improved and enhanced the English text as well.
It’s all merged now into the GitHub repository, where English and Russian sources (in AsciiDoc) live side-by-side.
P.S. If you’re looking for the English version, it’s (as always) here:
I made a new demo of water using Castle Game Engine. The demo is available in demo-models repository, in the
Open it with any viewer using the latest Castle Game Engine code, for example use the “daily build” of view3dscene. Here’s a movie:)