9 private float AnchorLeft;
12 private float AnchorTop;
15 private float AnchorRight;
18 private float AnchorBottom;
21 private float PositionX;
24 private float PositionY;
33 private float AlignmentX;
36 private float AlignmentY;
39 private bool SizeToContent;
41 protected Widget m_widget;
43 override void HandlerAttached(Widget w)
49 Print(
string.Format(
"Cannot initialize SCR_SlotUIComponent, widget '%1' has no parent!", w.GetName()), LogLevel.WARNING);
53 if (w.GetParent().GetTypeID() != WidgetType.FrameWidgetTypeID)
55 Print(
string.Format(
"Cannot initialize SCR_SlotUIComponent, parent of widget '%1' is not a FrameWidget!", w.GetName()), LogLevel.WARNING);
59 FrameSlot.SetAlignment(w, AlignmentX, AlignmentY);
60 FrameSlot.SetSizeToContent(w, SizeToContent);
61 FrameSlot.SetOffsets(w, AnchorLeft, AnchorTop, AnchorRight, AnchorBottom);
62 FrameSlot.SetAnchorMin(w, AnchorLeft, AnchorTop);
63 FrameSlot.SetAnchorMax(w, AnchorRight, AnchorBottom);
64 if (AnchorLeft == AnchorRight)
66 FrameSlot.SetPosX(w, PositionX);
67 FrameSlot.SetSizeX(w, SizeX);
69 if (AnchorTop == AnchorBottom)
71 FrameSlot.SetPosY(w, PositionY);
72 FrameSlot.SetSizeY(w, SizeY);
76 void SetPosX(
float x )
78 FrameSlot.SetPosX( m_widget, x );
81 void SetPosY(
float y )
83 FrameSlot.SetPosY( m_widget, y );
88 return FrameSlot.GetPosX( m_widget );
93 return FrameSlot.GetPosY( m_widget );