mirror of
https://github.com/raylib-cs/raylib-cs
synced 2025-09-09 03:01:41 -04:00
Merge branch 'master' into AttachAudioMixedProcessor-with-AllowUnsafeBlocks-false
This commit is contained in:
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
@@ -123,7 +123,8 @@ jobs:
|
|||||||
-B build \
|
-B build \
|
||||||
-D CMAKE_BUILD_TYPE=Release \
|
-D CMAKE_BUILD_TYPE=Release \
|
||||||
-D BUILD_SHARED_LIBS=ON \
|
-D BUILD_SHARED_LIBS=ON \
|
||||||
-D BUILD_EXAMPLES=OFF
|
-D BUILD_EXAMPLES=OFF \
|
||||||
|
-D CMAKE_C_FLAGS="${{ matrix.cflags }}"
|
||||||
cmake --build build --config Release
|
cmake --build build --config Release
|
||||||
|
|
||||||
- name: upload build
|
- name: upload build
|
||||||
@@ -190,7 +191,8 @@ jobs:
|
|||||||
-B build \
|
-B build \
|
||||||
-D CMAKE_BUILD_TYPE=Release \
|
-D CMAKE_BUILD_TYPE=Release \
|
||||||
-D BUILD_SHARED_LIBS=ON \
|
-D BUILD_SHARED_LIBS=ON \
|
||||||
-D BUILD_EXAMPLES=OFF
|
-D BUILD_EXAMPLES=OFF \
|
||||||
|
-D CMAKE_C_FLAGS="${{ matrix.cflags }}"
|
||||||
cmake --build build --config Release
|
cmake --build build --config Release
|
||||||
|
|
||||||
- name: upload build
|
- name: upload build
|
||||||
|
@@ -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.
|
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
|
dotnet add package Raylib-cs
|
||||||
```
|
```
|
||||||
|
@@ -33,6 +33,7 @@
|
|||||||
<CMakeArgs Include="-D CMAKE_BUILD_TYPE=$(Configuration)" />
|
<CMakeArgs Include="-D CMAKE_BUILD_TYPE=$(Configuration)" />
|
||||||
<CMakeArgs Include="-D BUILD_SHARED_LIBS=ON" />
|
<CMakeArgs Include="-D BUILD_SHARED_LIBS=ON" />
|
||||||
<CMakeArgs Include="-D BUILD_EXAMPLES=OFF" />
|
<CMakeArgs Include="-D BUILD_EXAMPLES=OFF" />
|
||||||
|
<!-- <CMakeArgs Include="-D GRAPHICS=GRAPHICS_API_OPENGL_43" /> -->
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="ConfigureNative" BeforeTargets="BuildNative" Condition="$(SkipLocalBuild) != true">
|
<Target Name="ConfigureNative" BeforeTargets="BuildNative" Condition="$(SkipLocalBuild) != true">
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
using System.Numerics;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Raylib_cs;
|
namespace Raylib_cs;
|
||||||
@@ -21,6 +22,50 @@ public partial struct Rectangle
|
|||||||
this.Height = height;
|
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()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return $"{{X:{X} Y:{Y} Width:{Width} Height:{Height}}}";
|
return $"{{X:{X} Y:{Y} Width:{Width} Height:{Height}}}";
|
||||||
|
Reference in New Issue
Block a user