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.
This commit is contained in:
parent
e09d6a4daa
commit
d723905f5c
5 changed files with 751 additions and 77 deletions
69
Raylib-cs/types/Circle.cs
Normal file
69
Raylib-cs/types/Circle.cs
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
using System.Numerics;
|
||||
|
||||
namespace Raylib_cs;
|
||||
|
||||
public struct Circle
|
||||
{
|
||||
public Vector2 position;
|
||||
public float radius;
|
||||
public Color color;
|
||||
|
||||
public float X
|
||||
{
|
||||
get
|
||||
{
|
||||
return position.X;
|
||||
}
|
||||
set
|
||||
{
|
||||
position.Y = value;
|
||||
}
|
||||
}
|
||||
|
||||
public float Y
|
||||
{
|
||||
get
|
||||
{
|
||||
return position.Y;
|
||||
}
|
||||
set
|
||||
{
|
||||
position.Y = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Circle(Vector2 position)
|
||||
{
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public Circle(float x, float y)
|
||||
{
|
||||
position = new Vector2(x, y);
|
||||
}
|
||||
|
||||
public Circle(float x, float y, Color color)
|
||||
{
|
||||
position = new Vector2(x, y);
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public Circle(Vector2 position, float radius)
|
||||
{
|
||||
this.position = position;
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
public Circle(float x, float y, float radius)
|
||||
{
|
||||
position = new Vector2(x, y);
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
public Circle(Vector2 position, float radius, Color color)
|
||||
{
|
||||
this.position = position;
|
||||
this.radius = radius;
|
||||
this.color = color;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue