Oscetch.MonoGame.Textures.DX
1.0.3
There is a newer version of this package available.
See the version list below for details.
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
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 | 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.
-
net6.0-windows7.0
- MonoGame.Framework.WindowsDX (>= 3.8.1.303)
- Oscetch.MonoGame.Math.DX (>= 1.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.