Oscetch.MonoGame.Textures.DX
1.0.4
dotnet add package Oscetch.MonoGame.Textures.DX --version 1.0.4
NuGet\Install-Package Oscetch.MonoGame.Textures.DX -Version 1.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="Oscetch.MonoGame.Textures.DX" Version="1.0.4" />
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.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Oscetch.MonoGame.Textures.DX, 1.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.
// Install Oscetch.MonoGame.Textures.DX as a Cake Addin #addin nuget:?package=Oscetch.MonoGame.Textures.DX&version=1.0.4 // Install Oscetch.MonoGame.Textures.DX as a Cake Tool #tool nuget:?package=Oscetch.MonoGame.Textures.DX&version=1.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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 | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0-windows7.0 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0-windows7.0
- MonoGame.Framework.WindowsDX (>= 3.8.2.1105)
- Oscetch.MonoGame.Math.DX (>= 1.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.