Table of Contents

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

texture Texture2D

The texture to use.

bounds Rectangle

The bounds of the region within the texture.

info Thickness

The 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

Thickness

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

context RenderContext

The render context to draw to.

dest Rectangle

The destination rectangle where the region will be drawn.

color Color

The color to blend with the texture.