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

◆ AddIndication()

static void Terraria.GameContent.Creative.CreativePowers.DifficultySliderPower.AddIndication ( UIPanel panel,
float yAnchor,
string indicationText,
string iconImagePath,
UIElement::ElementEvent updateEvent,
UIElement::MouseEvent clickEvent )
inlinestaticprivate

Definition at line 1068 of file CreativePowers.cs.

1069 {
1070 UIImage uIImage = new UIImage(Main.Assets.Request<Texture2D>(iconImagePath, (AssetRequestMode)1))
1071 {
1072 HAlign = 1f,
1073 VAlign = yAnchor,
1074 Left = new StyleDimension(4f, 0f),
1075 Top = new StyleDimension(2f, 0f),
1076 RemoveFloatingPointsFromDrawPosition = true
1077 };
1078 uIImage.OnMouseOut += Button_OnMouseOut;
1079 uIImage.OnMouseOver += Button_OnMouseOver;
1080 if (updateEvent != null)
1081 {
1082 uIImage.OnUpdate += updateEvent;
1083 }
1084 if (clickEvent != null)
1085 {
1086 uIImage.OnLeftClick += clickEvent;
1087 }
1088 panel.Append(uIImage);
1089 }
static void Button_OnMouseOut(UIMouseEvent evt, UIElement listeningElement)
static void Button_OnMouseOver(UIMouseEvent evt, UIElement listeningElement)

References Terraria.Main.Assets, Terraria.GameContent.Creative.CreativePowers.DifficultySliderPower.Button_OnMouseOut(), Terraria.GameContent.Creative.CreativePowers.DifficultySliderPower.Button_OnMouseOver(), and System.Collections.Generic.Left.

Referenced by Terraria.GameContent.Creative.CreativePowers.DifficultySliderPower.ProvideSlider().