Table of Contents

Class TintedRegion

Namespace
Myra.Graphics2D.TextureAtlases
Assembly
Myra.dll

Represents a texture region with a color tint applied.

public class TintedRegion : IImage, IBrush, IHasColor
Inheritance
TintedRegion
Implements
Inherited Members
Extension Methods

Constructors

TintedRegion(TextureRegion, Color)

Initializes a new instance of the TintedRegion class.

public TintedRegion(TextureRegion image, Color color)

Parameters

image TextureRegion

The texture region to tint.

color Color

The tint color to apply.

Properties

Color

Gets the tint color applied to the region.

public Color Color { get; }

Property Value

Color

Region

Gets the underlying texture region.

public TextureRegion Region { get; }

Property Value

TextureRegion

Size

Gets the size of the region.

public Point Size { get; }

Property Value

Point

Methods

Draw(RenderContext, Rectangle, Color)

Draws the tinted region to the specified destination rectangle.

public void Draw(RenderContext context, Rectangle dest, Color color)

Parameters

context RenderContext

The render context.

dest Rectangle

The destination rectangle.

color Color

The color to blend with the tint.

Equals(object)

Determines whether the specified object is equal to the current tinted region.

public override bool Equals(object obj)

Parameters

obj object

The object to compare.

Returns

bool

true if the regions and colors are equal; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

ToString()

Returns a string representation of the tinted region.

public override string ToString()

Returns

string

A string containing the region and color information.