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

◆ Clamp() [2/2]

static Vector2 Microsoft.Xna.Framework.Vector2.Clamp ( Vector2 value1,
Vector2 min,
Vector2 max )
inlinestatic

Definition at line 201 of file Vector2.cs.

202 {
203 float x = value1.X;
204 x = ((x > max.X) ? max.X : x);
205 x = ((x < min.X) ? min.X : x);
206 float y = value1.Y;
207 y = ((y > max.Y) ? max.Y : y);
208 y = ((y < min.Y) ? min.Y : y);
209 Vector2 result = default(Vector2);
210 result.X = x;
211 result.Y = y;
212 return result;
213 }
Vector2(float x, float y)
Definition Vector2.cs:35

References Microsoft.Xna.Framework.Vector2.X, and Microsoft.Xna.Framework.Vector2.Y.

Referenced by Terraria.NPC.AI(), Terraria.GameContent.Skies.AmbientSky.EOCSkyEntity.ChasePlayerTop(), Terraria.Main.ClampScreenPositionToWorld(), Terraria.Graphics.Capture.CaptureInterface.ModeEdgeSelection.DrawCursors(), and Terraria.Main.DrawInterface_GolfBallIndicator().