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.