Hi all,
I am having trouble with HUD/UI scaling. I am using a HUD message device to display a custom image (anchored to the center), and on top of that I’m using UI buttons made on a canvas through Verse. I separated the image and buttons like this because I thought it would make my code easier.
They both show, but when I try scaling the HUD in settings, the scaling only applies to the image and the buttons stay in place. This is how it looks with 100% and 50% scaling:
and this is the code:
var MyCanvas : canvas = canvas:
Slots:= array:
canvas_slot:
Widget:=ScrollLeftButton
Anchors := anchors{Minimum := vector2{X := 0.5, Y := 0.5}, Maximum := vector2{X := 0.5, Y := 0.5}}
ZOrder:=1
SizeToContent:=true
Offsets:=margin{Top:=272.0, Left:=150.0, Bottom:=130.0, Right:=134.0}
Alignment := vector2{X:=0.5, Y:=0.5}
canvas_slot:
Widget:=ScrollRightButton
Anchors := anchors{Minimum := vector2{X := 0.5, Y := 0.5}, Maximum := vector2{X := 0.5, Y := 0.5}}
ZOrder:=1
SizeToContent:=true
Offsets:=margin{Top:=272.0, Left:=793.0, Bottom:=130.0, Right:=134.0}
Alignment := vector2{X:=0.5, Y:=0.5}
canvas_slot:
Widget:=EnableDisableButton
Anchors := anchors{Minimum := vector2{X := 0.5, Y := 0.5}, Maximum := vector2{X := 0.5, Y := 0.5}}
ZOrder:=1
SizeToContent:=true
Offsets:=margin{Top:=272.0, Left:=465.0, Bottom:=110.0, Right:=200.0}
Alignment := vector2{X:=0.5, Y:=0.5}
canvas_slot:
Widget:=ExitButton
Anchors := anchors{Minimum := vector2{X := 0.5, Y := 0.5}, Maximum := vector2{X := 0.5, Y := 0.5}}
ZOrder:=1
SizeToContent:=true
Offsets:=margin{Top:=-240.0, Left:=793.0, Bottom:=110.0, Right:=110.0}
Alignment := vector2{X:=0.5, Y:=0.5}
The fix would probably be to use one canvas for everything, but I’m wondering why it cannot function like this and how I could make the scaling work for both the image and buttons in this manner. Help is appreciated!