All Projects → BlizzCrafter → MonoGame.SplineFlower

BlizzCrafter / MonoGame.SplineFlower

Licence: MIT License
Create wonderful smooth Bézier-, CatMulRom- and Hermite-Splines with Trigger Events for your MonoGame project.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to MonoGame.SplineFlower

MonoGame.Forms
MonoGame.Forms is the easiest way of integrating a MonoGame render window into your Windows Forms project. It should make your life much easier, when you want to create your own editor environment.
Stars: ✭ 183 (+916.67%)
Mutual labels:  nuget, engine, monogame, windows-forms, engines, monogame-framework, editors
Monogame.forms
MonoGame.Forms is the easiest way of integrating a MonoGame render window into your Windows Forms project. It should make your life much easier, when you want to create your own editor environment.
Stars: ✭ 165 (+816.67%)
Mutual labels:  nuget, engine, monogame, windows-forms
Ecsrx
A reactive take on the ECS pattern for .net game developers
Stars: ✭ 288 (+1500%)
Mutual labels:  nuget, monogame
Apos.input
Polling input library for MonoGame.
Stars: ✭ 25 (+38.89%)
Mutual labels:  nuget, monogame
Nopipeline
A Monogame Content Pipeline enhancer.
Stars: ✭ 152 (+744.44%)
Mutual labels:  monogame, monogame-framework
Protogame
This project has been sunset as of 1st Jan 2018 and is no longer supported or maintained
Stars: ✭ 166 (+822.22%)
Mutual labels:  engine, monogame
Apos.Gui
UI library for MonoGame.
Stars: ✭ 77 (+327.78%)
Mutual labels:  nuget, monogame
Nil.js
JavaScript engine for .NET written in C#.
Stars: ✭ 236 (+1211.11%)
Mutual labels:  nuget, engine
Unity-Procedural
Spline based mesh generation
Stars: ✭ 67 (+272.22%)
Mutual labels:  splines, catmull-rom
cocos2d-mono
Continuation of Cocos2D-XNA project, with focus on MonoGame
Stars: ✭ 18 (+0%)
Mutual labels:  monogame, monogame-framework
Spatial.Engine
[WIP] Spatial is a cross-platform C++ game engine.
Stars: ✭ 50 (+177.78%)
Mutual labels:  engine, engines
Steamworks.Net-MonoGame-Integration
This repo is for everyone who is about to integrate the Steamworks.Net.dll into a MonoGame project. It shows some Steamworks.Net features and how easy it is to integrate it into a MonoGame project.
Stars: ✭ 30 (+66.67%)
Mutual labels:  monogame, monogame-framework
Simplexrpgengine
Modular game engine built with MonoGame, with GMS2-like workflow and advanced level editor
Stars: ✭ 122 (+577.78%)
Mutual labels:  engine, monogame
Openviii Monogame
Open source Final Fantasy VIII engine implementation in C# working on Windows and Linux (Android and iOS planned too!) [Monogame]
Stars: ✭ 424 (+2255.56%)
Mutual labels:  engine, monogame
MiniRTS
A game engine to learn about game engine development
Stars: ✭ 99 (+450%)
Mutual labels:  engine, monogame
DungeonMaster.NET
Reimplementation of famous old Dungeon Master game.
Stars: ✭ 23 (+27.78%)
Mutual labels:  engine, monogame
MonoGame.Primitives2D
Easy-to-use 2D primitives
Stars: ✭ 44 (+144.44%)
Mutual labels:  monogame, monogame-framework
Apos.Shapes
Shape rendering in MonoGame.
Stars: ✭ 21 (+16.67%)
Mutual labels:  nuget, monogame
MLEM
MLEM Library for Extending MonoGame provides extension methods, improvements and additional features like a ui system and easy input handling.
Stars: ✭ 26 (+44.44%)
Mutual labels:  monogame, monogame-framework
clay
Cross-platform 2d game framework
Stars: ✭ 39 (+116.67%)
Mutual labels:  engine

Banner

Welcome to MonoGame.SplineFlower!

Twitter Follow License

NuGet NuGet NuGet

Create wonderful smooth Bézier-, CatMulRom- and Hermite-Splines with TriggerEvents for your MonoGame project.

Building

  • The MonoGame.SplineFlower project is compatible with the MonoGame.Framework 3.6 and above.

How-To

Setup

The Visual Studio 2019 solution contains the following projects:

  • MonoGame.SplineFlower (the portable class library)
  • MonoGame.SplineFlower.Content (spline data and setup class)
  • MonoGame.SplineFlower.Content.Pipeline (creates .xnb files out of .json spline data)
  • MonoGame.SplineFlower.Samples (showing features of the library)
  • MonoGame.SplineFlower.Editor (create, import and export splines)
  • MonoGame.SplineFlower.GameTest (DesktopGL project which loads a spline with the ContentManager)
  1. In your own MonoGame project you need to reference MonoGame.SplineFlower if you want to use the library capabilities
  2. If you want to load splines with the ContentManager, you also need to reference MonoGame.SplineFlower.Content.Pipeline

Note: You don't need this reference if you want to load spline data with Json.Net

  1. When you want to draw the spline - inclusive trigger events - you need to reference MonoGame.SplineFlower.Content to have access to the static class Setup, because you need to call Setup.Initialize(graphics.GraphicsDevice); for this purpose

Note: You don't need this reference if you don't want to draw your splines. You don't need to draw splines at all. This is just a Debug feature to make your life as a game developer easier ;)

For an easy installation you should make use of the nuget package manager: Nuget

Capabilities

So what can this library actually do for you? [Watch the Video!] (Outdated!)

Despite drawing simple lines, it generates very smooth BézierCurves, BézierSplines, CatMulRomSplines and HermiteSplines pretty fast, because it uses polynomial math formulas behind the scenes.

This makes it possible to generate:

Quadratic BézierCurves

BezierCurve_Quadratic

Cubic BézierCurves

BezierCurve_Cubic

Complex BézierSplines

BezierSpline

Complex CatMulRomSplines

CatMulRomSpline

Chain Splines

ChainSplines

Complex HermiteSplines

HermiteSplines

Polygon Stripe Splines

PolygonStripe

Did you notice the different colors of the control points? You can set them in 3 different modes:

ControlModes

  • Free allows you to freely place the control point, but often resulting in sharp corners.
  • Aligned will enforce such corners and allow you to have connected control points asymmetrical.
  • Mirrored behave like the aligned one, but allow you to have the connected control points symmetrical.

Note: A CatmulRomSpline will always have its control points in the Free mode!

You can change control modes simply by clicking on them with the Right Mouse Button in the:

MonoGame.SplineFlower.Editor

Editor

It is also possible to create looped splines as you can see! With the Middle Mouse Button you can drag the whole spline to keep the overview.

Did you noticed the nice little car on the picture? This is a SplineWalker.

A SplineWalker can, well... walk on splines :) or drive on it like in the case of a car, hehe.

You have the abillity to create your own SplineWalkers by inheritting from the SplineWalker class mentioned above.

This could look like this:

public class Car : SplineWalker
{
    public override void CreateSplineWalker(BezierSpline spline, SplineWalkerMode mode, int duration, bool canTriggerEvents = true, bool    autoStart = true)
    {
        base.CreateSplineWalker(spline, mode, duration, canTriggerEvents, autoStart);
    }
    
    protected override void EventTriggered(Trigger obj)
    {
        base.EventTriggered(obj);
    }
    
    public override void Update(GameTime gameTime)
    {
        base.Update(gameTime);
    }
    
    public override void Draw(SpriteBatch spriteBatch)
    {
        base.Draw(spriteBatch);
    }
}

Click here to see a full integration example.

A nice thing about a SplineWalker is, that he can trigger custom events on a spline while he walks along the spline.

You can define your own Trigger with the TriggerEditor:

TriggerEditor

It is reachable from the main editor through the Tools button.

A SplineWalker also has 3 different built-in movement modes:

  • Once travels the spline just one time and will stop at the last control point.
  • Looped travels the spline infinitely (smoothly starts again at the starting point).
  • PingPong travels the spline forward and then backward when he reaches the last control point / starting point (infinitely).

It's also possible to define different trigger directions:

  • Forward triggers only in the forward direction.
  • Backward triggers only in the backward direction.
  • ForwardAndBackward triggers in both directions.

Note: It's also possible to control a SplineWalker with your Keyboard or GamePad if you wish so!


You can do pretty much anything with splines. The limit is really just your imagination. Play around with the samples and learn from it.

CatMulRomSpline

Now Have Fun with MonoGame.SplineFlower!

Twitter Follow

Logo

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].