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

◆ CullPointsOutOfElementArea()

void Terraria.GameContent.UI.States.UIGamepadHelper.CullPointsOutOfElementArea ( SpriteBatch spriteBatch,
List< SnapPoint > pointsAtMiddle,
UIElement container )
inline

Definition at line 316 of file UIGamepadHelper.cs.

317 {
318 float num = 1f / Main.UIScale;
319 Rectangle clippingRectangle = container.GetClippingRectangle(spriteBatch);
320 Vector2 minimum = clippingRectangle.TopLeft() * num;
321 Vector2 maximum = clippingRectangle.BottomRight() * num;
322 for (int i = 0; i < pointsAtMiddle.Count; i++)
323 {
324 if (!pointsAtMiddle[i].Position.Between(minimum, maximum))
325 {
327 i--;
328 }
329 }
330 }
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
Rectangle GetClippingRectangle(SpriteBatch spriteBatch)
Definition UIElement.cs:246

References System.Collections.Generic.Dictionary< TKey, TValue >.Count, Terraria.UI.UIElement.GetClippingRectangle(), System.Collections.Generic.Dictionary< TKey, TValue >.Remove(), and Terraria.Main.UIScale.

Referenced by Terraria.GameContent.UI.States.UICharacterCreation.SetupGamepadPoints(), and Terraria.GameContent.UI.States.UIResourcePackSelectionMenu.SetupGamepadPoints().