mirror of
				https://github.com/raylib-cs/raylib-cs
				synced 2025-10-31 06:04:58 -04:00 
			
		
		
		
	Update README.md
This commit is contained in:
		
							
								
								
									
										49
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										49
									
								
								README.md
									
									
									
									
									
								
							| @@ -7,17 +7,18 @@ C# bindings for raylib, a simple and easy-to-use library to learn videogames pro | ||||
| # Installation | ||||
| 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.EndDrawing(); | ||||
|         } | ||||
|  | ||||
| 		rl.CloseWindow(); | ||||
| 	} | ||||
|         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. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user