Hi, I’m facing a very annoying problem with the UI.
All my color_blocks and texture blocks don’t want to display. Text_blocks work perfectly.
I isolated the problem to run tests but without success, still the same problem.
Is this a bug from the last update, or am I doing something wrong?
If anyone goes through this and knows why it doesn’t work, please let me know.
You can test it, just copy the in an empty projet and tell me if it’s just me lol
Code
OnBegin<override>()<suspends>:void=
Sleep(5.0)
# TEST
for (Player : GetPlayspace().GetPlayers(), UI := GetPlayerUI[Player]):
UI.AddWidget(MakeTestUI())
MakeTestUI():canvas=
Print("TEST")
LobbyBackground : texture_block = texture_block{DefaultImage := UIElements.BGLobbyUI, DefaultDesiredSize := vector2{X := 1920.0, Y := 1080.0}}
LobbyBackground2 : color_block = color_block{DefaultColor := NamedColors.Black, DefaultDesiredSize := vector2{X := 1920.0, Y := 1080.0}, DefaultOpacity := 1.0}
TextBlock : text_block = text_block{DefaultText := StringToMessage("Hello World"), DefaultTextColor := NamedColors.White, DefaultTextOpacity := 1.0}
Canvas : canvas = canvas:
Slots := array:
canvas_slot: # Text Background
Widget := LobbyBackground2
Anchors := anchors{Minimum := vector2{X := 0.5, Y := 0.5}, Maximum := vector2{X := 0.5, Y := 0.5}}
Offsets := margin{Top := 0.0, Left := 0.0, Right := 0.0, Bottom := 0.0}
Alignment := vector2{X := 0.5, Y := 0.5}
SizeToContent := false
canvas_slot: # Test Text
Widget := TextBlock
Anchors := anchors{Minimum := vector2{X := 0.5, Y := 0.5}, Maximum := vector2{X := 0.5, Y := 0.5}}
Offsets := margin{Top := 0.0, Left := 0.0, Right := 0.0, Bottom := 0.0}
Alignment := vector2{X := 0.5, Y := 0.5}
SizeToContent := true
return Canvas
The result (Background doesn’t show):
EDIT : i found the solution, just need to remove the SizeToContent line in the color_block widget