Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ PowerStripUIElement()

Terraria.GameContent.UI.Elements.PowerStripUIElement.PowerStripUIElement ( string gamepadGroupName,
List< UIElement > buttons )
inline

Definition at line 13 of file PowerStripUIElement.cs.

14 {
17 int count = buttons.Count;
18 int num = 4;
19 int num2 = 40;
20 int num3 = 40;
21 int num4 = num3 + num;
22 UIPanel uIPanel = new UIPanel
23 {
24 Width = new StyleDimension(num2 + num * 2, 0f),
25 Height = new StyleDimension(num3 * count + num * (1 + count), 0f)
26 };
27 SetPadding(0f);
28 Width = uIPanel.Width;
29 Height = uIPanel.Height;
30 uIPanel.BorderColor = new Color(89, 116, 213, 255) * 0.9f;
31 uIPanel.BackgroundColor = new Color(73, 94, 171) * 0.9f;
32 uIPanel.SetPadding(0f);
34 for (int i = 0; i < count; i++)
35 {
37 uIElement.HAlign = 0.5f;
38 uIElement.Top = new StyleDimension(num + num4 * i, 0f);
39 uIElement.SetSnapPoint(_gamepadPointGroupname, i);
40 uIPanel.Append(uIElement);
42 }
43 }
StyleDimension Height
Definition UIElement.cs:29
void Append(UIElement element)
Definition UIElement.cs:166
StyleDimension Width
Definition UIElement.cs:27
void SetPadding(float pixels)
Definition UIElement.cs:361

References Terraria.GameContent.UI.Elements.PowerStripUIElement._buttonsBySorting, Terraria.GameContent.UI.Elements.PowerStripUIElement._gamepadPointGroupname, System.Collections.Generic.List< T >.Add(), Terraria.UI.UIElement.Append(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, Terraria.UI.UIElement.Height, Terraria.UI.UIElement.SetPadding(), and Terraria.UI.UIElement.Width.