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

◆ GetGridParameters()

void Terraria.GameContent.UI.Elements.UIDynamicItemCollection.GetGridParameters ( out int startX,
out int startY,
out int startItemIndex,
out int endItemIndex )
inlineprivate

Definition at line 91 of file UIDynamicItemCollection.cs.

92 {
94 Rectangle viewCullingArea = base.Parent.GetViewCullingArea();
95 int x = rectangle.Center.X;
96 startX = x - (int)((float)(44 * _itemsPerLine) * 0.5f);
97 startY = rectangle.Top;
100 int num = (Math.Min(viewCullingArea.Top, rectangle.Top) - viewCullingArea.Top) / 44;
101 startY += -num * 44;
103 int num2 = (int)Math.Ceiling((float)viewCullingArea.Height / 44f) * _itemsPerLine;
105 {
107 }
108 }
static byte Min(byte val1, byte val2)
Definition Math.cs:912
static double Ceiling(double a)
CalculatedStyle GetDimensions()
Definition UIElement.cs:382

References Terraria.GameContent.UI.Elements.UIDynamicItemCollection._itemIdsAvailableToShow, Terraria.GameContent.UI.Elements.UIDynamicItemCollection._itemsPerLine, System.Math.Ceiling(), System.Collections.Generic.List< T >.Count, Terraria.UI.UIElement.GetDimensions(), System.Math.Min(), and Terraria.UI.CalculatedStyle.ToRectangle().

Referenced by Terraria.GameContent.UI.Elements.UIDynamicItemCollection.DrawSelf(), and Terraria.GameContent.UI.Elements.UIDynamicItemCollection.GetSnapPoints().