Oscetch.MonoGame.Textures.DX 1.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package Oscetch.MonoGame.Textures.DX --version 1.0.3                
NuGet\Install-Package Oscetch.MonoGame.Textures.DX -Version 1.0.3                
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="Oscetch.MonoGame.Textures.DX" Version="1.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Oscetch.MonoGame.Textures.DX --version 1.0.3                
#r "nuget: Oscetch.MonoGame.Textures.DX, 1.0.3"                
#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.
// Install Oscetch.MonoGame.Textures.DX as a Cake Addin
#addin nuget:?package=Oscetch.MonoGame.Textures.DX&version=1.0.3

// Install Oscetch.MonoGame.Textures.DX as a Cake Tool
#tool nuget:?package=Oscetch.MonoGame.Textures.DX&version=1.0.3                

Oscetch.MonoGame.Textures

A library for generating monogame textures

Usage

The library can generate these shapes:

  • Circle/Ellipse
  • Cross
  • Rectangle
  • Rectangle with a corner radius
  • Rectangle with a cross in the middle
  • X shape
  • Triangle
  • Dialog box, which is just a rounded corner rectangle, without any radius on the bottom left

To generate a texture you create a builder, set the parameters and build:

var textureParams = new CustomTextureParametersBuilder()
  .WithSize(300)
  .WithBorderThickness(10)
  .WithFillColor(Color.White)
  .WithBorderColor(Color.Violet)
  .WithCornerRadius(20)
  .WithShape(ShapeType.RectangleCornerRadius)
  .Build();

Then use the CustomTextureManager to get the texture:

var texture = CustomTextureManager.GetCustomTexture(textureParams, GraphicsDevice);

The CustomTextureManager will cache the texture with the parameters you gave it. So the same texture will be reused if you try to build the same texture multiple times. To clear this cache you call:

CustomTextureManager.ClearCache();
Product Compatible and additional computed target framework versions.
.NET net6.0-windows7.0 is compatible.  net7.0-windows was computed.  net8.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
1.0.4 98 10/12/2024
1.0.3 103 7/21/2024
1.0.2 108 6/19/2024
1.0.1 106 6/19/2024
1.0.0 290 12/21/2021