Watch
2
0
Fork
You've already forked raylib-cs
0
raylib-cs/Raylib-cs/types/Line.cs
Matorio d723905f5c Extensions and explicit types
Added a new "RaylibExtensions" static class that gives overloaded extension methods to types so you can use them directly instead of calling the raylib class for everything.

Two new types: "Circle" and "Line"

All the "var" variables were changed to explicit types on the raylib class.

"MakeDirectory" overload, and string version of "GetApplicationDirectory" and "GetWorkingDirectory" methods.
2025-06-20 18:41:16 -05:00

39 lines
826 B
C#

using System.Numerics;
namespace Raylib_cs;
public struct Line
{
public Vector2 pointA;
public Vector2 pointB;
public Line(Vector2 p1, Vector2 p2)
{
pointA = p1;
pointB = p2;
}
public Line(Vector2 startPos, float endPosX, float endPosY)
{
pointA = startPos;
pointB = new Vector2(endPosX, endPosY);
}
public Line(float startPosX, float startPosY, Vector2 endPos)
{
pointA = new Vector2(startPosX, startPosY);
pointB = endPos;
}
public Line(float startPosX, float startPosY, float endPosX, float endPosY)
{
pointA = new Vector2(startPosX, startPosY);
pointB = new Vector2(endPosX, endPosY);
}
public readonly override string ToString()
{
return $"P1: {pointA}, P2: {pointB}";
}
}