MonoGizmo 1.0.1

dotnet add package MonoGizmo --version 1.0.1
                    
NuGet\Install-Package MonoGizmo -Version 1.0.1
                    
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="MonoGizmo" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MonoGizmo" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="MonoGizmo" />
                    
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 MonoGizmo --version 1.0.1
                    
#r "nuget: MonoGizmo, 1.0.1"
                    
#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.
#:package MonoGizmo@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MonoGizmo&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=MonoGizmo&version=1.0.1
                    
Install as a Cake Tool

MonoGizmo

A simple and esy to use 2D Gizmo library for MonoGame. The package is build on netstandard2.1 and the graphics have been created using the amazing library Apos.Shapes

Nuget → The nuget package fails to load a required FX file from AposShapes resulting in startup errors. Download the project and reference it in your own program. WORKAROUND: Download the aposshapes.fx file and load it into your own Contet file. This will make sure it is being compiled correctly to your own Graphics profile.

Demo

Features

For the moment only basic gizmo functionality is available but more functionality is expected in the future.

Currently implemented:

  • 4 included Gizmos: Origin, Translate, Rotate, Scale
  • 2 coordinate systems: World, Local
  • Customize Gizmo size and color

Future ideeas:

  • Grid System (guides / snap to grid)
  • Step Transforms (how much things should move! currently the mouse dictates the ammount of movement, not very precises is it..)

How it works

The Gizmos are controlled by a class names GizmoManager. Besides Updating and Rendering the Gizmos, this class also contains the Selection functionality of the entities that inherit the ISelectable interface. The entities are checked for mouse clicks and intersections once they are added to the Selectables property of the manager. A QuadTree is used for optimizing the selection process.

The Gizmos can be turned On or Off by using the ActivateType(GizmoType) function from the GizmoManager. The Selection can also be cleared from here.

Check out the MonoGizmo.tests project for an installation and utilization example.

ISelectable

One of the key features of this library is its flexibility regarding the type of bounds that a selectable object can implement. The library does not impose any specific type for the bounds, allowing users to define and use their own custom bounds types. This design choice ensures that users are not limited by the library's implementation and can integrate their own logic and structures seamlessly.

In the example project, the Selectable class implements the ISelectable and IEntity interfaces, which define properties and methods for handling bounds, scaling, translation, and rotation. The Center property allows for easy manipulation of the object's center point, while the IsSelected function provides a bounds specific way of determining if the mouse clicked inside a selectable object. However, the actual type of the bounds is not restricted, enabling users to implement their own bounds logic / selection as needed.

This flexibility allows for a wide range of use cases and customizations, making the library adaptable to various project requirements.

Check how this was implemented in the example project.

Included Gizmos

  • Origin : Represents the center point of the ISelectable entity. Dragging this Gizmo will cause the selected entity to follow <img src="https://github.com/CuvinStefanCristian/MonoGizmo/blob/master/Resources/Origin.png" />

  • Translate: Changes the position of the entity on the X and Y axis. This is achieved by grabbing the Arrows <img src="https://github.com/CuvinStefanCristian/MonoGizmo/blob/master/Resources/Translate.png" />

  • Roate : Rotates the selected entity around it's center / origin (the origin doesn't need to be active). This is done by dragging the ring in the desired rotation direction <img src="https://github.com/CuvinStefanCristian/MonoGizmo/blob/master/Resources/Rotate.png" />

  • Scale : This Gizmo modifies the Width and Height of the selected entity <img src="https://github.com/CuvinStefanCristian/MonoGizmo/blob/master/Resources/Scale.png" />

World vs Local coordinates

  • World These are absolute coordinates of where the game object is located (by absolute, I mean with respect to the world frame, which is considered to be absolute in the game) <img src="https://github.com/CuvinStefanCristian/MonoGizmo/blob/master/Resources/WorldCoordinates.png" />

  • Local These coordinates take into accdount the orientation (rotation) of the object <img src="https://github.com/CuvinStefanCristian/MonoGizmo/blob/master/Resources/LocalCoordinates.png" /> Notice how the Gizmos have now changed their orientation to match the rotation of the object

Need help ?

Contact me on Discord and we'll try to figure things out ! (no promises though) username: ATLANTISorg

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • No dependencies.

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
1.0.1 123 2/15/2025
1.0.0 107 2/15/2025