Hi,
How can I:
- automatically center an OnScreenMenu on my window (backgroundpicture) or
- make it fill the whole window, and
- keep it partially transparant so my background picture is shown through it.
Thanks.
Hi,
How can I:
Thanks.
TCastleOnScreenMenu is regular UI control (descendant of TCastleUserInterface), so you can center it as other UI controls (see https://castle-engine.io/manual_2d_user_interface.php ):
MyOnScreenMenu.Anchor(vpMiddle);
MyOnScreenMenu.Anchor(hpMiddle);
It should be automatically transparent by default, so the background picture is visible underneath.
Note that you can also do it visually, using CGE editor. Just use TCastleVerticalGroup
with a number of TCastleButton
inside. You can style the buttons in a lot of ways (see e.g. examples/component_gallery/
for demo) so you can achieve any look this way.
TCastleOnScreenMenu
is not (yet?) available in the CGE editor because TCastleVerticalGroup
+ a bunch of TCastleButton
works equally well in practice, and is easier to customize look.