mirror of
https://github.com/raylib-cs/raylib-cs
synced 2025-04-03 11:09:40 -04:00
Update README.md
This commit is contained in:
parent
a9571ccb30
commit
f365315121
53
README.md
53
README.md
@ -5,19 +5,20 @@
|
||||
C# bindings for raylib, a simple and easy-to-use library to learn videogames programming (www.raylib.com)
|
||||
|
||||
# Installation
|
||||
So far, I have only done a few tests on Windows and Linux.
|
||||
So far, I have only done a few tests on Windows and Linux.
|
||||
|
||||
## Package
|
||||
1. Install the [nuget package](https://www.nuget.org/packages/Raylib-cs/)
|
||||
There is a [nuget package](https://www.nuget.org/packages/Raylib-cs/) although it is currently out of date.
|
||||
|
||||
2. Start coding!
|
||||
1. Copy or reference the bindings folder in your project. See the test projects for reference.
|
||||
|
||||
## Manual
|
||||
1. Copy or reference the bindings in your project. See Tests for reference.
|
||||
2. The bindings need a native library to load. It should match your platform and configuration. You can either:
|
||||
- Download a raylib [release](https://github.com/raysan5/raylib/releases).
|
||||
|
||||
2. Make sure your project finds the native library that matches your platform and configuration.
|
||||
- Build raylib from source. Use this if your using module bindings that are not built in releases.
|
||||
|
||||
3. Start coding!
|
||||
3. Make sure the native library is in a place your project can find it. This will vary for your platform. See https://www.mono-project.com/docs/advanced/pinvoke/ for more details.
|
||||
|
||||
4. Start coding!
|
||||
|
||||
```csharp
|
||||
using Raylib;
|
||||
@ -25,31 +26,31 @@ using rl = Raylib.Raylib;
|
||||
|
||||
static class Program
|
||||
{
|
||||
public static void Main()
|
||||
{
|
||||
rl.InitWindow(640, 480, "Hello World");
|
||||
public static void Main()
|
||||
{
|
||||
rl.InitWindow(640, 480, "Hello World");
|
||||
|
||||
while (!rl.WindowShouldClose())
|
||||
{
|
||||
rl.BeginDrawing();
|
||||
while (!rl.WindowShouldClose())
|
||||
{
|
||||
rl.BeginDrawing();
|
||||
|
||||
rl.ClearBackground(Color.WHITE);
|
||||
rl.DrawText("Hello, world!", 12, 12, 20, Color.BLACK);
|
||||
rl.ClearBackground(Color.WHITE);
|
||||
rl.DrawText("Hello, world!", 12, 12, 20, Color.BLACK);
|
||||
|
||||
rl.EndDrawing();
|
||||
}
|
||||
|
||||
rl.CloseWindow();
|
||||
}
|
||||
rl.EndDrawing();
|
||||
}
|
||||
|
||||
rl.CloseWindow();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
# Tech notes
|
||||
- Enums are passed as `int` to prevent the need for explicit casts.
|
||||
- Color defines stored inside `Color`.
|
||||
- Uses `string.Format` in place of `TextFormat`.
|
||||
- Structs have constructors.
|
||||
- Operator overloads for math types.
|
||||
- Certain funtions take a enum instead of a int such as 'IsKeyPressed'.
|
||||
- Colors stored in the `Color` struct. 'RED' changes to 'Color.RED'
|
||||
- Uses `string.Format` instead of `TextFormat`.
|
||||
- Adds constructors for structs.
|
||||
- Adds operator overloads for math structs.
|
||||
|
||||
# Contributing
|
||||
If you have any ideas, feel free to open an issue and tell me what you think.
|
||||
|
Loading…
x
Reference in New Issue
Block a user