diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c3e7899..c98627b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -123,7 +123,8 @@ jobs: -B build \ -D CMAKE_BUILD_TYPE=Release \ -D BUILD_SHARED_LIBS=ON \ - -D BUILD_EXAMPLES=OFF + -D BUILD_EXAMPLES=OFF \ + -D CMAKE_C_FLAGS="${{ matrix.cflags }}" cmake --build build --config Release - name: upload build @@ -190,7 +191,8 @@ jobs: -B build \ -D CMAKE_BUILD_TYPE=Release \ -D BUILD_SHARED_LIBS=ON \ - -D BUILD_EXAMPLES=OFF + -D BUILD_EXAMPLES=OFF \ + -D CMAKE_C_FLAGS="${{ matrix.cflags }}" cmake --build build --config Release - name: upload build diff --git a/README.md b/README.md index 4cc4b8a..5d93ab7 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,13 @@ Raylib-cs targets net5.0 and net6.0 and uses the [official 4.5.0 release](https: This is the prefered method to get started. +1) Pick a folder in which you would like to start a raylib project for example "MyRaylibCSProj" +2) Then from a terminal (for example a VSCode terminal), whilst in the folder dir you just created + run the following commands. (Please keep in mind you should have .NET already installed on your system) + +``` +dotnet new console +``` ``` dotnet add package Raylib-cs ``` diff --git a/Raylib-cs.Native/Raylib-cs.Native.csproj b/Raylib-cs.Native/Raylib-cs.Native.csproj index 2ac0971..1fbe25a 100644 --- a/Raylib-cs.Native/Raylib-cs.Native.csproj +++ b/Raylib-cs.Native/Raylib-cs.Native.csproj @@ -33,6 +33,7 @@ + diff --git a/Raylib-cs/types/Rectangle.cs b/Raylib-cs/types/Rectangle.cs index 3f1c7ab..9f6eb21 100644 --- a/Raylib-cs/types/Rectangle.cs +++ b/Raylib-cs/types/Rectangle.cs @@ -1,3 +1,4 @@ +using System.Numerics; using System.Runtime.InteropServices; namespace Raylib_cs; @@ -21,6 +22,50 @@ public partial struct Rectangle this.Height = height; } + public Rectangle(Vector2 position, float width, float height) + { + this.X = position.X; + this.Y = position.Y; + this.Width = width; + this.Height = height; + } + + public Rectangle(float x, float y, Vector2 size) + { + this.X = x; + this.Y = y; + this.Width = size.X; + this.Height = size.Y; + } + + public Rectangle(Vector2 position, Vector2 size) + { + this.X = position.X; + this.Y = position.Y; + this.Width = size.X; + this.Height = size.Y; + } + + public Vector2 Position + { + readonly get { return new Vector2(X,Y); } + set + { + X = value.X; + Y = value.Y; + } + } + + public Vector2 Size + { + readonly get { return new Vector2(Width,Height); } + set + { + Width = value.X; + Height = value.Y; + } + } + public override string ToString() { return $"{{X:{X} Y:{Y} Width:{Width} Height:{Height}}}";