Gorgon
Show / Hide Table of Contents

Class GorgonKeyTexture2D

An animation key frame for a GorgonTexture2DView, texture coordinates and a texture array index.

Inheritance
object
GorgonKeyTexture2D
Implements
IGorgonKeyFrame
IGorgonCloneable<IGorgonKeyFrame>
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Gorgon.Animation
Assembly: Gorgon.Animation.dll
Syntax
public class GorgonKeyTexture2D : IGorgonKeyFrame, IGorgonCloneable<IGorgonKeyFrame>
Remarks

A key frame represents a value for an object property at a given time.

The track that the key frame is on is used to interpolate the value between key frames. This method makes it so that only a few key frames are required for an animation rather then setting a value for every time index.

The track for this key frame does not use interpolation. This means that there is no smooth transition between values and each value is "snapped" to when animating.

Constructors

| Edit this page View Source

GorgonKeyTexture2D(GorgonKeyTexture2D)

Initializes a new instance of the GorgonKeyTexture2D class.

Declaration
public GorgonKeyTexture2D(GorgonKeyTexture2D key)
Parameters
Type Name Description
GorgonKeyTexture2D key

The key to copy.

Exceptions
Type Condition
ArgumentNullException

Thrown when the key parameter is null.

See Also
IGorgonAnimationTrack<T>
| Edit this page View Source

GorgonKeyTexture2D(float, GorgonTexture2DView, RectangleF, int)

Initializes a new instance of the GorgonKeyTexture2D class.

Declaration
public GorgonKeyTexture2D(float time, GorgonTexture2DView value, RectangleF textureCoordinates, int textureArrayIndex)
Parameters
Type Name Description
float time

The time for the key frame.

GorgonTexture2DView value

The value to apply to the key frame.

RectangleF textureCoordinates

Region on the texture to update.

int textureArrayIndex

The texture array index to use with a texture array.

See Also
IGorgonAnimationTrack<T>
| Edit this page View Source

GorgonKeyTexture2D(float, string, RectangleF, int)

Initializes a new instance of the GorgonKeyTexture2D class.

Declaration
public GorgonKeyTexture2D(float time, string textureName, RectangleF textureCoordinates, int textureArrayIndex)
Parameters
Type Name Description
float time

The time for the key frame.

string textureName

The name of the texture that should be applied to the key frame.

RectangleF textureCoordinates

Region on the texture to update.

int textureArrayIndex

The texture array index to use with a texture array.

Remarks

This overload is used to build a key frame that references a texture, but without having that texture loaded into memory. This is useful for serialization scenarios.

Exceptions
Type Condition
ArgumentNullException

Thrown when the textureName parameter is null.

ArgumentEmptyException

Thrown when the textureName parameter is empty.

See Also
IGorgonAnimationTrack<T>

Properties

| Edit this page View Source

DataType

Property to return the type of data for this key frame.

Declaration
public Type DataType { get; }
Property Value
Type Description
Type
See Also
IGorgonAnimationTrack<T>
| Edit this page View Source

TextureArrayIndex

Property to set or return the texture array index to use on a texture array.

Declaration
public ref int TextureArrayIndex { get; }
Property Value
Type Description
int
See Also
IGorgonAnimationTrack<T>
| Edit this page View Source

TextureCoordinates

Property to set or return the texture coordinates.

Declaration
public ref RectangleF TextureCoordinates { get; }
Property Value
Type Description
RectangleF
See Also
IGorgonAnimationTrack<T>
| Edit this page View Source

TextureName

Property to return the name of the texture.

Declaration
[JsonIgnore]
public string TextureName { get; }
Property Value
Type Description
string
See Also
IGorgonAnimationTrack<T>
| Edit this page View Source

Time

Property to return the time at which the key frame is stored.

Declaration
public float Time { get; }
Property Value
Type Description
float
See Also
IGorgonAnimationTrack<T>
| Edit this page View Source

Value

Property to set or return the texture view to use.

Declaration
public GorgonTexture2DView Value { get; set; }
Property Value
Type Description
GorgonTexture2DView
See Also
IGorgonAnimationTrack<T>

Methods

| Edit this page View Source

Clone()

Function to clone the key.

Declaration
public IGorgonKeyFrame Clone()
Returns
Type Description
IGorgonKeyFrame

The cloned key.

See Also
IGorgonAnimationTrack<T>

Implements

IGorgonKeyFrame
IGorgonCloneable<T>

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)

See Also

IGorgonAnimationTrack<T>
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author