Class GorgonSpriteColors
Defines the colors for each corner of a sprite rectangle.
Implements
Inherited Members
Namespace: Gorgon.Renderers
Assembly: Gorgon.Renderers.Gorgon2D.dll
Syntax
public class GorgonSpriteColors : IReadOnlyList<GorgonColor>, IReadOnlyCollection<GorgonColor>, IEnumerable<GorgonColor>, IEnumerable
Properties
| Edit this page View SourceCount
Gets the number of elements in the collection.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int |
this[int]
Property to set or return the corner color by index.
Declaration
public GorgonColor this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
int | index |
Property Value
Type | Description |
---|---|
GorgonColor |
Remarks
The ordering of the indices is as follows: 0 - Upper left, 1 - Upper right, 2 - Lower right, 3 - Lower left.
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown when the |
LowerLeft
Property to set or return the color of the lower left corner.
Declaration
public GorgonColor LowerLeft { get; set; }
Property Value
Type | Description |
---|---|
GorgonColor |
LowerRight
Property to set or return the color of the lower right corner.
Declaration
public GorgonColor LowerRight { get; set; }
Property Value
Type | Description |
---|---|
GorgonColor |
UpperLeft
Property to set or return the color of the upper left corner.
Declaration
public GorgonColor UpperLeft { get; set; }
Property Value
Type | Description |
---|---|
GorgonColor |
UpperRight
Property to set or return the color of the upper right corner.
Declaration
public GorgonColor UpperRight { get; set; }
Property Value
Type | Description |
---|---|
GorgonColor |
Methods
| Edit this page View SourceCopyTo(GorgonSpriteColors)
Function to copy the colors into the specified destination.
Declaration
public void CopyTo(GorgonSpriteColors destination)
Parameters
Type | Name | Description |
---|---|---|
GorgonSpriteColors | destination | The destination that will receive the copy of the colors. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<GorgonColor> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<GorgonColor> | An enumerator that can be used to iterate through the collection. |
SetAll(in GorgonColor)
Function to assign a single color to all corners.
Declaration
public void SetAll(in GorgonColor color)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | color | The color to assign. |