Interface IGorgonAnimationCodec
An interface used to serialize or deserialize a IGorgonAnimation.
Inherited Members
Namespace: Gorgon.IO
Assembly: Gorgon.IO.Gorgon2D.dll
Syntax
public interface IGorgonAnimationCodec : IGorgonNamedObject
Properties
| Edit this page View SourceCanDecode
Property to return whether or not the codec can decode animation data.
Declaration
bool CanDecode { get; }
Property Value
Type | Description |
---|---|
bool |
See Also
| Edit this page View SourceCanEncode
Property to return whether or not the codec can encode animation data.
Declaration
bool CanEncode { get; }
Property Value
Type | Description |
---|---|
bool |
See Also
| Edit this page View SourceCodec
Property to return the abbreviated name of the codec (e.g. PNG).
Declaration
string Codec { get; }
Property Value
Type | Description |
---|---|
string |
See Also
| Edit this page View SourceCodecDescription
Property to return the friendly description of the format.
Declaration
string CodecDescription { get; }
Property Value
Type | Description |
---|---|
string |
See Also
| Edit this page View SourceFileExtensions
Property to return the common file extensions for an animation.
Declaration
IReadOnlyList<GorgonFileExtension> FileExtensions { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<GorgonFileExtension> |
See Also
| Edit this page View SourceRenderer
Property to return the renderer used to create objects.
Declaration
Gorgon2D Renderer { get; }
Property Value
Type | Description |
---|---|
Gorgon2D |
See Also
| Edit this page View SourceVersion
Property to return the version of animation data that the codec supports.
Declaration
Version Version { get; }
Property Value
Type | Description |
---|---|
Version |
See Also
Methods
| Edit this page View SourceFromFile(string, string, IEnumerable<GorgonTexture2DView>)
Function to read the animation data from a file on the physical file system.
Declaration
IGorgonAnimation FromFile(string filePath, string name = null, IEnumerable<GorgonTexture2DView> textureOverrides = null)
Parameters
Type | Name | Description |
---|---|---|
string | filePath | The path to the file to read. |
string | name | [Optional] The name of the animation. |
IEnumerable<GorgonTexture2DView> | textureOverrides | [Optional] Textures to use in a texture animation track. |
Returns
Type | Description |
---|---|
IGorgonAnimation | A new IGorgonAnimation. |
Remarks
When passing in a list of textureOverrides
, the texture names should match the expected texture names in the key frame. For example, if the
TextureName is "WalkingFrames"
, then the Name should also be "WalkingFrames"
.
See Also
| Edit this page View SourceFromStream(Stream, int?, string, IEnumerable<GorgonTexture2DView>)
Function to read the animation data from a stream.
Declaration
IGorgonAnimation FromStream(Stream stream, int? byteCount = null, string name = null, IEnumerable<GorgonTexture2DView> textureOverrides = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream containing the animation. |
int? | byteCount | [Optional] The number of bytes to read from the stream. |
string | name | [Optional] The name of the animation. |
IEnumerable<GorgonTexture2DView> | textureOverrides | [Optional] Textures to use in a texture animation track. |
Returns
Type | Description |
---|---|
IGorgonAnimation | A new IGorgonAnimation. |
Remarks
When passing in a list of textureOverrides
, the texture names should match the expected texture names in the key frame. For example, if the
TextureName is "WalkingFrames"
, then the Name should also be "WalkingFrames"
.
See Also
| Edit this page View SourceGetAssociatedTextureNames(Stream)
Function to retrieve the names of the textures associated with the animation.
Declaration
IReadOnlyList<string> GetAssociatedTextureNames(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream containing the texture data. |
Returns
Type | Description |
---|---|
IReadOnlyList<string> | The names of the texture associated with the animations, or an empty list if no textures were found. |
See Also
| Edit this page View SourceIsReadable(Stream)
Function to determine if the data in a stream is readable by this codec.
Declaration
bool IsReadable(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream containing the data. |
Returns
Type | Description |
---|---|
bool | true if the data can be read, or false if not. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
GorgonException | Thrown if the |
EndOfStreamException | Thrown if the current |
NotSupportedException | This method is not supported by this codec. |
See Also
| Edit this page View SourceSave(IGorgonAnimation, Stream)
Function to save the animation data to a stream.
Declaration
void Save(IGorgonAnimation animation, Stream stream)
Parameters
Type | Name | Description |
---|---|---|
IGorgonAnimation | animation | The animation to serialize into the stream. |
Stream | stream | The stream that will contain the animation. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
GorgonException | Thrown if the stream is read only. |
NotSupportedException | This method is not supported by this codec. |
See Also
| Edit this page View SourceSave(IGorgonAnimation, string)
Function to save the animation data to a file on a physical file system.
Declaration
void Save(IGorgonAnimation animation, string filePath)
Parameters
Type | Name | Description |
---|---|---|
IGorgonAnimation | animation | The animation to serialize into the file. |
string | filePath | The path to the file to write. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentEmptyException | Thrown when the |
NotSupportedException | This method is not supported by this codec. |