From 98b6c899b1d7595cbaef00627861674fa9208958 Mon Sep 17 00:00:00 2001 From: Jeffery Myers Date: Mon, 6 Sep 2021 08:56:07 -0700 Subject: [PATCH] Created Visual Studio C# Setup (markdown) --- Visual-Studio-C#-Setup.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Visual-Studio-C#-Setup.md diff --git a/Visual-Studio-C#-Setup.md b/Visual-Studio-C#-Setup.md new file mode 100644 index 0000000..4346475 --- /dev/null +++ b/Visual-Studio-C#-Setup.md @@ -0,0 +1,36 @@ +Setting up raylib in Visual Studio is very simple. + +1) Download and install Visual Studio (note, if you have used unity in the past, you probably have this already) +2) Create a new C# Console Application Project from the File -> New -> Project Menu +3) After the project is created, Right click on the project and choose "managed nuget projects" +4) Choose the Browse tab and type in "Raylib". +5) Select the "raylib-cs" package from the list and choose 'install' from the panel on the right. +6) Build your raylib game in C# by using the Raylib_cs library. + +A simple main program looks like this + +`using System;` + +`using Raylib_cs;` + +`namespace ConsoleApp` +`{` + `class Program` + `{` + `static void Main(string[] args)` + `{` + `Raylib.InitWindow(800, 600, "TEST");` + + `while (!Raylib.WindowShouldClose())` + `{` + `Raylib.BeginDrawing();` + `Raylib.ClearBackground(Color.RAYWHITE);` + + `Raylib.DrawText("Hello C# Window", 10, 10, 20, Color.RED);` + + `Raylib.EndDrawing();` + `}` + `Raylib.CloseWindow();` + `}` + `}` +`}`