DaveGreen.ShapeEngine 4.0.4

Prefix Reserved
dotnet add package DaveGreen.ShapeEngine --version 4.0.4
                    
NuGet\Install-Package DaveGreen.ShapeEngine -Version 4.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DaveGreen.ShapeEngine" Version="4.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DaveGreen.ShapeEngine" Version="4.0.4" />
                    
Directory.Packages.props
<PackageReference Include="DaveGreen.ShapeEngine" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DaveGreen.ShapeEngine --version 4.0.4
                    
#r "nuget: DaveGreen.ShapeEngine, 4.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=DaveGreen.ShapeEngine&version=4.0.4
                    
Install DaveGreen.ShapeEngine as a Cake Addin
#tool nuget:?package=DaveGreen.ShapeEngine&version=4.0.4
                    
Install DaveGreen.ShapeEngine as a Cake Tool

My custom-made engine based on the great Raylib Framework. The Main focus is being performant and only using draw functions instead of textures.

When using Shape Engine everything from Raylib is available as well. (Raylib ExamplesRaylib Cheatsheet)

Shape Engine´s examples are available on Itch as well and it is a great way to support me 😉

You are free to use Shape Engine or any part of Shape Engine for your own projects, but keep in mind that Shape Engine was designed to help me with my specific game dev needs. Nevertheless I am looking forward to creations that Shape Engine made possible 😃

Release Trailer

Getting Started & Documentation

This repository includes an Examples Project to showcase the capabilities of ShapeEngine and help you get started quickly. Explore the examples to see what’s possible and how to implement different features.

  • Documentation:
    Documentation is available here.

  • Documentation Source:
    You can find the documentation repository here.

For any issues, suggestions, or questions about the docs, please open an issue in the ShapeEngineDocs repository.

Development Process

The Main Branch contains the current development stage. You can follow the development process here:

Installation / How to Use

There are multiple ways to use Shape Engine:

  1. Create a new solution & project and download Shape Engine from the Nuget manager. (Recommended)
dotnet add package DaveGreen.ShapeEngine
  1. Clone or fork the repository and add new projects to the solution. You then can reference the Shape Engine project and start working on your game. The advantages are that you can easily change things in Shape Engine and everything updates automatically in your own project.
  2. Create a new solution & project in a .net IDE. (Visual Studio / JetBrains Rider for example). Download or fork ShapeEngine and either create a local nuget package or build the solution to create all necessary dll files.
  3. [Using a local Nuget Package] Create a folder on your machine called something like “Local Nuget Packages” and copy the ShapeEngine Nuget package that you created to this folder. (You can also add the Shape Engine Nuget package directly to your Project). Now you need to create a new Package source in the Nuget Manager that points to your “Local Nuget Packages” Folder. This source can be used in your Nuget Manager to find and install the Shape Engine Nuget Package.
  4. You manually copy all needed DLL files to your project. You need the following DLLs: Clipper2Lib, Raylib-Cs, Microsoft.Toolkit.HighPerformance, Shape Engine Core, Raylib. All DLL files except Raylib can be anywhere in your projects folder hierarchy. The Raylib DLL must be on the root level of your project. You need to select the right Raylib DLL for your operating system. Now just add a reference for all DLLs except the Raylib DLL and you are done. On MacOS you need to do the same step except using the .dylib file instead of the raylib DLL. You need to set the property “Copy if Newer” to true on the .dylib file. Then everything should work.
  5. Create a new solution & project and just add the Shape Engine Core DLL to your project and reference it. Now you need to download the right version of the Raylib_CsLo & Clipper2 Nuget packages. The releases on GitHub will state which versions were used.

Minimal Project Setup

using System.Drawing; 
using ShapeEngine.Color; 
using ShapeEngine.Core; 
using ShapeEngine.Core.Structs; 
using ShapeEngine.StaticLib.Drawing;

namespace ShapeEngineProject;   

public static class Program 
{     
    public static void Main(string[] args)     
    {         
        var game = new MyGameClass(GameSettings.StretchMode, WindowSettings.Default);
		game.Run();    
    } 
} 

public class MyGameClass : Game 
{     
    public MyGameClass(GameSettings gameSettings, WindowSettings windowSettings) : base(gameSettings, windowSettings) { }     
    
    protected override void DrawGame(ScreenInfo game)     
    {         
        game.Area.Draw(new ColorRgba(Color.DarkOliveGreen));         
        game.Area.DrawLines(12f, new ColorRgba(Color.AntiqueWhite));         
        game.MousePos.Draw(24f, new ColorRgba(Color.Lime), 36);     
    } 
} 

Examples

You can download the newest builds of the Example Project on Itch io. You can clone the repo and inspect the example projects there as well.

  • Examples are simple scenes that focus on one specific area or feature of Shape Engine.
  • Examples showcase the various capabilities of Shape Engine, allowing users to explore various features.
  • The examples cover all major features of Shape Engine, ensuring that users can grasp its full potential.

Features

In general my goal is to provide the most relevant system a game dev needs without adding a solution for every possible problem.

Dependencies

I am just using the Raylib Cs c# bindings and the Cipper2 library for polygon clipping.

If you use the nuget manager to download Shape Engine as a nuget package you don't have to take care of any dependencies, because they will be downloaded automatically.

Limitations

There is no physics system because I don´t need one and would´t know how to make one. There is complete collision system but the collision response is up to you. You can also use raylibs physics system.

History

I made Shape Engine because I wanted to help myself make games with a specific art style and certain limitations. At first, it started out with some helper scripts but now it is a relatively sophisticated system to make games with raylib. Certain parts of the basic game loop are inspired by Bytepath and other things I already used in games that I made myself (especially Fracture Hell). Feel free to use any single part if you don´t want to use the whole package.

Contact

If you have an issue, or a suggestion for a new feature GitHub is the best way to get in contact with me.

On these platforms you can follow the development process of Shape Engine, get in contact with me and always stay up date.

Linktree

https://linktr.ee/davegreen.games

https://linktr.ee/shapeengine

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
4.0.4 121 5/30/2025
4.0.3 147 5/28/2025
4.0.2 136 5/27/2025
4.0.1 133 5/22/2025
4.0.0 171 5/16/2025
3.1.0 197 12/15/2024
3.0.0 100 12/9/2024
2.4.0 145 11/6/2024
2.3.1 118 10/23/2024
2.3.0 115 10/21/2024
2.2.0 111 10/4/2024
2.1.1 150 9/11/2024
2.1.0 111 9/8/2024
2.0.2 124 8/30/2024
2.0.1 122 8/29/2024
2.0.0 114 8/29/2024
1.0.3 171 6/5/2024
1.0.2 128 6/1/2024
1.0.1 133 5/29/2024
1.0.0 128 5/23/2024

#4.0.4 Release
- Docs are now available (they are not complete and still a work in progress)
- Link: https://davegreen-games.github.io/ShapeEngineDocs/

#4.0.3 Release
- Automated Nuget Package Upload Workflow tested

#4.0.2 Release
- ShapePhysics CalculateDragFactor functions is now public.
- ShapeVec added ClampLength(v, max) ClampLength(v, min, max) functions.
- ShapeMath added IsSignEqual() (int and float) functions.

#4.0.1 Release
- Added missing XML documentation file to the nuget package.

#4.0.0 Release

This release took 4 months to complete.
Originally, I just wanted to add the new Ray and Line shapes for drawing and collision detection, but it ended up being much more.
I took a look at physics, added some new functions, and cleaned up the PhysicsObject class. DrawCheckered was renamed to DrawStriped, and I added a lot of new variations as well.
There were many small changes, bug fixes, and improvements all over ShapeEngine. There are still things I wanted to add, but I decided to release 4.0 right now.

Changelog:
- Line and Ray shapes added. Both are defined by a Point and a Direction.
- The Line is infinitely long in both directions from the point, and a Ray is infinitely long in one direction from the point.
- Intersect / Overlap / ClosestPoint functions added to Line and Ray.
- Intersect / Overlap / ClosestPoint functions overhauled and cleaned up for all remaining shapes (Segments, Points, Triangulation and Collider as well) to make everything consistent.
- Line and Ray added to Cast/Query Space functions in CollisionHandler.
- ShapesExample improved. Automated Testing and Projection added.
- ShapesExample renamed to ShapeIntersectionExample
- ShapeProjectionExample removed.
- DrawCheckered renamed to DrawStriped
- DrawStriped implemented for all closed shapes (Circle, Triangle, Rect, Quad, Polygon)
- DrawStriped code improved with new line intersection functions
- DrawStriped function with an outside and an inside shape. The striped lines will fill the outside shape and not the inside shape.
- DrawShapeOutline example added
- DrawShapeStriped example added
- Physics! Example added
- CurveDataExample added
- Curve generic class implemented. Allows adding key-value pairs. Each key is time between 0 - 1. Allow sampling for a value at a certain time point. The value will be an interpolation between the values at the key before and after the time point.
- CurveFloat, CurveInt, CurveVector2, CurveColor are implemented
- ContainsShape functions overhauled for all closed shapes (Circle, Triangle, Rect, Quad, Polygon)
- Polygon ContainsShape functions now properly check if the shape is contained. Previously, it would only check if all points are contained within the polygon, but would not check if the edges intersect the polygon.
- Circle and Polygon have special ContainsShape code that uses intersection tests as well (other shapes just check if all points from the other shape are inside)
- Raylib Cs bindings updated to 7.0.1
- Clipper2 updated to 1.5.3
- Static functions from PhysicsObject moved to the new static ShapePhysics class
- Friction, Drag, Elastic Collision, Attraction, and Repulsion functions added to the ShapePhysics class
- DrawArrow functions added to the ShapeDrawing class
- ShapeDrawing was split into multiple files for each shape type: ShapePointDrawing, ShapeSegmentDrawing, ShapeLineDrawing, ShapeRayDrawing, ShapeTriangleDrawing, ShapeCircleDrawing, ShapeRectDrawing, ShapeQuadDrawing, ShapePolygonDrawing, ShapePolylineDrawing, ShapeDrawing, ShapeCustomDrawing, ShapeRingDrawing, ShapeGappedDrawing, ShapeStripedDrawing, ShapeUIDrawing
- ShapeEngine.Lib namespace was renamed to ShapeEngine.StaticLib
- Deferred Drawing System added to the Game class