Class GorgonAnimationBuilder
A builder used to create IGorgonAnimation objects.
Implements
Inherited Members
Namespace: Gorgon.Animation
Assembly: Gorgon.Animation.dll
Syntax
public class GorgonAnimationBuilder : IGorgonFluentBuilder<GorgonAnimationBuilder, IGorgonAnimation>
Remarks
This builder is used to create and configure an animation with key frames for the various animation tracks.
Animations are composed of multiple tracks which represent the properties on the objects that are to be animated. Within these tracks, there are multiple key frames which indicate the value of the property at a specified time (measured in seconds). When the animation plays, the values in these key frames are interpolated between each frame to give the appearance of a smooth transition between the values.
When building an animation using this builder type the tracks are edited via one of the several Edit methods on the builder. Each edit method corresponds to the type of data for the track (e.g. Vector2, float, etc...) and takes the registration TrackName of the track to indicate which track (and object property) is being edited.
Methods
| Edit this page View SourceBuild(string, float, float?)
Function to return the newly built animation.
Declaration
public IGorgonAnimation Build(string name, float fps = 60, float? length = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the animation. |
float | fps | [Optional] The frames per second for the animation. |
float? | length | [Optional] The length of the animation, in seconds. |
Returns
Type | Description |
---|---|
IGorgonAnimation | The object created or updated by this builder. |
Remarks
When the fps
parameter is omitted, it will default to 60 frames per second. This parameter is used to adjust the key frame times to fit within the specified frame delays
for the frames per second. If this value is less than 1, the animation will be assumed to be 1 frame per second.
When the length
parameter is omitted, the length of the animation will be calculated based on the key frame times present in the tracks. This may not be ideal for certain
cases, so supplying this value will force the animation length to be as long as the user requires. If 0, or less is supplied to this parameter the length will be reset to exactly 1 frame of
animation (one frame = 1 / fps
).
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentEmptyException | Thrown when the |
See Also
| Edit this page View SourceClear()
Function to clear the builder to a default state.
Declaration
public GorgonAnimationBuilder Clear()
Returns
Type | Description |
---|---|
GorgonAnimationBuilder | The fluent builder interface. |
See Also
| Edit this page View SourceDelete2DTexture(string)
Function to delete a track that updates a GorgonTexture2DView, texture coordinates, and/or texture array indices for its key frame values.
Declaration
public GorgonAnimationBuilder Delete2DTexture(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The registration name of the track to delete. |
Returns
Type | Description |
---|---|
GorgonAnimationBuilder | The fluent builder for the animation. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentEmptyException | Thrown when the |
KeyNotFoundException | Thrown if the track with the name specified does not exist. |
See Also
| Edit this page View SourceDeleteColor(string)
Function to delete a track that updates a GorgonColor value for its key frame values.
Declaration
public GorgonAnimationBuilder DeleteColor(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The registration name of the track to delete. |
Returns
Type | Description |
---|---|
GorgonAnimationBuilder | The fluent builder for the animation. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentEmptyException | Thrown when the |
KeyNotFoundException | Thrown if the track with the name specified does not exist. |
See Also
| Edit this page View SourceDeleteQuaternion(string)
Function to delete a track that updates a Quaternion value for its key frame values.
Declaration
public GorgonAnimationBuilder DeleteQuaternion(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The registration name of the track to delete. |
Returns
Type | Description |
---|---|
GorgonAnimationBuilder | The fluent builder for the animation. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentEmptyException | Thrown when the |
KeyNotFoundException | Thrown if the track with the name specified does not exist. |
See Also
| Edit this page View SourceDeleteRectangle(string)
Function to delete a track that updates a SharpDX RectangleF
value for its key frame values.
Declaration
public GorgonAnimationBuilder DeleteRectangle(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The registration name of the track to delete. |
Returns
Type | Description |
---|---|
GorgonAnimationBuilder | The fluent builder for the animation. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentEmptyException | Thrown when the |
KeyNotFoundException | Thrown if the track with the name specified does not exist. |
See Also
| Edit this page View SourceDeleteSingle(string)
Function to delete a track that updates a single floating point value for its key frame values.
Declaration
public GorgonAnimationBuilder DeleteSingle(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The registration name of the track to delete. |
Returns
Type | Description |
---|---|
GorgonAnimationBuilder | The fluent builder for the animation. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentEmptyException | Thrown when the |
KeyNotFoundException | Thrown if the track with the name specified does not exist. |
See Also
| Edit this page View SourceDeleteVector2(string)
Function to delete a track that updates a 2D vector value for its key frame values.
Declaration
public GorgonAnimationBuilder DeleteVector2(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The registration name of the track to delete. |
Returns
Type | Description |
---|---|
GorgonAnimationBuilder | The fluent builder for the animation. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentEmptyException | Thrown when the |
KeyNotFoundException | Thrown if the track with the name specified does not exist. |
See Also
| Edit this page View SourceDeleteVector3(string)
Function to delete a track that updates a 3D vector value for its key frame values.
Declaration
public GorgonAnimationBuilder DeleteVector3(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The registration name of the track to delete. |
Returns
Type | Description |
---|---|
GorgonAnimationBuilder | The fluent builder for the animation. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentEmptyException | Thrown when the |
KeyNotFoundException | Thrown if the track with the name specified does not exist. |
See Also
| Edit this page View SourceDeleteVector4(string)
Function to delete a track that updates a 4D vector value for its key frame values.
Declaration
public GorgonAnimationBuilder DeleteVector4(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The registration name of the track to delete. |
Returns
Type | Description |
---|---|
GorgonAnimationBuilder | The fluent builder for the animation. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentEmptyException | Thrown when the |
KeyNotFoundException | Thrown if the track with the name specified does not exist. |
See Also
| Edit this page View SourceEdit2DTexture(string)
Function to edit a track that updates a GorgonTexture2DView, texture coordinates, and/or texture array indices for its key frame values.
Declaration
public IGorgonTrackKeyBuilder<GorgonKeyTexture2D> Edit2DTexture(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The registration name of the track to edit. |
Returns
Type | Description |
---|---|
IGorgonTrackKeyBuilder<GorgonKeyTexture2D> | The builder used to update the requested animation track. |
Remarks
If no track exists with the specified name
, then a new track is created.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentEmptyException | Thrown when the |
See Also
| Edit this page View SourceEditColor(string)
Function to edit a track that uses GorgonColor values for its key frame values.
Declaration
public IGorgonTrackKeyBuilder<GorgonKeyGorgonColor> EditColor(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The registration name of the track to edit. |
Returns
Type | Description |
---|---|
IGorgonTrackKeyBuilder<GorgonKeyGorgonColor> | The builder used to update the requested animation track. |
Remarks
If no track exists with the specified name
, then a new track is created.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentEmptyException | Thrown when the |
See Also
| Edit this page View SourceEditQuaternion(string)
Function to edit a track that uses quaternions for its key frame values.
Declaration
public IGorgonTrackKeyBuilder<GorgonKeyQuaternion> EditQuaternion(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The registration name of the track to edit. |
Returns
Type | Description |
---|---|
IGorgonTrackKeyBuilder<GorgonKeyQuaternion> | The builder used to update the requested animation track. |
Remarks
If no track exists with the specified name
, then a new track is created.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentEmptyException | Thrown when the |
See Also
| Edit this page View SourceEditRectangle(string)
Function to edit a track that uses SharpDX RectangleF
values for its key frame values.
Declaration
public IGorgonTrackKeyBuilder<GorgonKeyRectangle> EditRectangle(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The registration name of the track to edit. |
Returns
Type | Description |
---|---|
IGorgonTrackKeyBuilder<GorgonKeyRectangle> | The builder used to update the requested animation track. |
Remarks
If no track exists with the specified name
, then a new track is created.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentEmptyException | Thrown when the |
See Also
| Edit this page View SourceEditSingle(string)
Function to edit a track that uses single floating point values for its key frame values.
Declaration
public IGorgonTrackKeyBuilder<GorgonKeySingle> EditSingle(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The registration name of the track to edit. |
Returns
Type | Description |
---|---|
IGorgonTrackKeyBuilder<GorgonKeySingle> | The builder used to update the requested animation track. |
Remarks
If no track exists with the specified name
, then a new track is created.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentEmptyException | Thrown when the |
See Also
| Edit this page View SourceEditVector2(string)
Function to edit a track that uses 2D vectors for its key frame values.
Declaration
public IGorgonTrackKeyBuilder<GorgonKeyVector2> EditVector2(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The registration name of the track to edit. |
Returns
Type | Description |
---|---|
IGorgonTrackKeyBuilder<GorgonKeyVector2> | The builder used to update the requested animation track. |
Remarks
If no track exists with the specified name
, then a new track is created.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentEmptyException | Thrown when the |
See Also
| Edit this page View SourceEditVector3(string)
Function to edit a track that uses 3D vectors for its key frame values.
Declaration
public IGorgonTrackKeyBuilder<GorgonKeyVector3> EditVector3(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The registration name of the track to edit. |
Returns
Type | Description |
---|---|
IGorgonTrackKeyBuilder<GorgonKeyVector3> | The builder used to update the requested animation track. |
Remarks
If no track exists with the specified name
, then a new track is created.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentEmptyException | Thrown when the |
See Also
| Edit this page View SourceEditVector4(string)
Function to edit a track that uses 4D vectors for its key frame values.
Declaration
public IGorgonTrackKeyBuilder<GorgonKeyVector4> EditVector4(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The registration name of the track to edit. |
Returns
Type | Description |
---|---|
IGorgonTrackKeyBuilder<GorgonKeyVector4> | The builder used to update the requested animation track. |
Remarks
If no track exists with the specified name
, then a new track is created.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentEmptyException | Thrown when the |
See Also
| Edit this page View SourceResetTo(IGorgonAnimation)
Function to reset the builder to the specified object state.
Declaration
public GorgonAnimationBuilder ResetTo(IGorgonAnimation builderObject = null)
Parameters
Type | Name | Description |
---|---|---|
IGorgonAnimation | builderObject | [Optional] The specified object state to copy. |
Returns
Type | Description |
---|---|
GorgonAnimationBuilder | The fluent builder interface. |
Remarks
Passing null to the builderObject
parameter will clear the builder settings.