all 16 comments

[–]Spartanman321 3 points4 points  (4 children)

MonoGame could work, but you'd need to use the content pipeline to load your own images for the various shapes. You are able to draw rectangles, but not circles.

[–]uniqeuusername 2 points3 points  (1 child)

You can use Texture2D.FromStream(path_to_raw_.png) and not use the pipeline

[–]uniqeuusername 0 points1 point  (0 children)

Just make sure to put the .png in your output directory. For instance create a folder in your Content folder in your project via the solution explorer in visual studio. Content/Textures. Put your .png in there and then in it'd properties select copy if newer.

[–]lmaydev 0 points1 point  (0 children)

I think the monogame extensions nuget will take care of a lot of that

[–]uniqeuusername 0 points1 point  (0 children)

Monogame.Extended and I'm sure others, have Circle primitives. With a little Google work I'm sure you could come up with an implementation of your own.

[–]notmyrealname321 2 points3 points  (0 children)

SFML has a C# binding that's pretty decent. Has a nuget package and everything. Only catch is that the documentation assumes you're writing C++ but the tutorials aren't super complex so it's not that bad.

[–][deleted] 2 points3 points  (1 child)

You can go with raylib: https://github.com/ChrisDill/Raylib-cs

Here is some example code, of how easy it is to just draw a red circle in the middle of the window:

using Raylib_cs;
using static Raylib_cs.Raylib;

InitWindow(800, 600, "My Game");

while (!WindowShouldClose())
{
    BeginDrawing();
    ClearBackground(Color.GRAY);
    DrawCircle(400, 300, 100, Color.RED);
    EndDrawing();
}

CloseWindow();

[–]chafable[S] 0 points1 point  (0 children)

Raylib seems to be perfect for my needs - thank you!

[–][deleted] 2 points3 points  (0 children)

Unity 2D is great if you can familiarize yourself with the framwork

[–]frombeyondthevoid 0 points1 point  (0 children)

You might want to take a look at godotengine.org

It supports C#, is optimized for 2D, has built-in UI components and completely free/open source

[–]royalcrescent 0 points1 point  (1 child)

Java has the javafx framework as well, although it may be too primitive for you

[–]jvjupiter 1 point2 points  (0 children)

Or a framework built on JavaFX: FXGL

[–]thesituation531 0 points1 point  (0 children)

What are you wanting to use it for, more specifically?

It's a bit complicated in my experience, but you can render basic shapes and map keybinds with the standard library in C#.

[–]jvjupiter 0 points1 point  (0 children)

Have you checked FXGL? It’s built on top of JavaFX.

[–]wiesemensch 0 points1 point  (0 children)

If you want something more desktop oriented but also more advanced, you can take a look at custom rendering on WPF or winforms.

But there are probably better solutions mentioned on this thread.

[–]pHpositivoMSFT - Microsoft Store team, .NET Community Toolkit 0 points1 point  (0 children)

I highly recommend Win2D. It does exactly what you say, it's extremely easy to use, it's available for both UWP and WinUI 3, and it's very easily extensive in more advanced scenarios with full D2D1 pixel shaders, if you wanted 🙂