Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ PlotTileLine() [2/2]

static bool Terraria.Utils.PlotTileLine ( Vector2D start,
Vector2D end,
double width,
TileActionAttempt plot )
inlinestatic

Definition at line 1677 of file Utils.cs.

1678 {
1679 //IL_0019: Unknown result type (might be due to invalid IL or missing references)
1680 //IL_001a: Unknown result type (might be due to invalid IL or missing references)
1681 //IL_001b: Unknown result type (might be due to invalid IL or missing references)
1682 //IL_0020: Unknown result type (might be due to invalid IL or missing references)
1683 //IL_0021: Unknown result type (might be due to invalid IL or missing references)
1684 //IL_0029: Unknown result type (might be due to invalid IL or missing references)
1685 //IL_002e: Unknown result type (might be due to invalid IL or missing references)
1686 //IL_002f: Unknown result type (might be due to invalid IL or missing references)
1687 //IL_0036: Unknown result type (might be due to invalid IL or missing references)
1688 //IL_003c: Unknown result type (might be due to invalid IL or missing references)
1689 //IL_0042: Unknown result type (might be due to invalid IL or missing references)
1690 //IL_0047: Unknown result type (might be due to invalid IL or missing references)
1691 //IL_0049: Unknown result type (might be due to invalid IL or missing references)
1692 //IL_004a: Unknown result type (might be due to invalid IL or missing references)
1693 //IL_004c: Unknown result type (might be due to invalid IL or missing references)
1694 //IL_0058: Unknown result type (might be due to invalid IL or missing references)
1695 //IL_0059: Unknown result type (might be due to invalid IL or missing references)
1696 //IL_005b: Unknown result type (might be due to invalid IL or missing references)
1697 //IL_0067: Unknown result type (might be due to invalid IL or missing references)
1698 //IL_006f: Unknown result type (might be due to invalid IL or missing references)
1699 double num = width / 2.0;
1700 Vector2D val = end - start;
1701 Vector2D val2 = val / ((Vector2D)(ref val)).Length();
1702 Vector2D val3 = new Vector2D(0.0 - val2.Y, val2.X) * num;
1703 Point point = (start - val3).ToTileCoordinates();
1705 Point point3 = start.ToTileCoordinates();
1706 Point point4 = end.ToTileCoordinates();
1707 Point lineMinOffset = new Point(point.X - point3.X, point.Y - point3.Y);
1708 Point lineMaxOffset = new Point(point2.X - point3.X, point2.Y - point3.Y);
1709 return PlotLine(point3.X, point3.Y, point4.X, point4.Y, (int x, int y) => PlotLine(x + lineMinOffset.X, y + lineMinOffset.Y, x + lineMaxOffset.X, y + lineMaxOffset.Y, plot, jump: false));
1710 }
static Point ToTileCoordinates(this Vector2 vec)
Definition Utils.cs:1248
static bool PlotLine(Point16 p0, Point16 p1, TileActionAttempt plot, bool jump=true)
Definition Utils.cs:1566

References Terraria.Utils.PlotLine(), Microsoft.Xna.Framework.Graphics.Point, System.start, Terraria.Utils.ToTileCoordinates(), Microsoft.Xna.Framework.Point.X, and Microsoft.Xna.Framework.Point.Y.