Class NinePatchRegion
- Namespace
- Myra.Graphics2D.TextureAtlases
- Assembly
- Myra.dll
Represents a nine-patch texture region that can be stretched while maintaining corner and edge appearance.
public class NinePatchRegion : TextureRegion, IImage, IBrush
- Inheritance
-
NinePatchRegion
- Implements
- Inherited Members
- Extension Methods
Constructors
NinePatchRegion(Texture2D, Rectangle, Thickness)
Initializes a new instance of the NinePatchRegion class with the specified texture, bounds, and patch information.
public NinePatchRegion(Texture2D texture, Rectangle bounds, Thickness info)
Parameters
textureTexture2DThe texture to use.
boundsRectangleThe bounds of the region within the texture.
infoThicknessThe thickness information that defines the nine-patch layout.
Properties
Info
Gets the thickness information that defines the nine-patch layout.
public Thickness Info { get; }
Property Value
Methods
Draw(RenderContext, Rectangle, Color)
Draws the nine-patch region to the specified render context at the given destination, scaling the center while maintaining corner and edge appearance.
public override void Draw(RenderContext context, Rectangle dest, Color color)
Parameters
contextRenderContextThe render context to draw to.
destRectangleThe destination rectangle where the region will be drawn.
colorColorThe color to blend with the texture.