Interface IGorgonSpriteCodec
An interface used to serialize and deserialize GorgonSprite objects.
Namespace: Gorgon.IO
Assembly: Gorgon.IO.Gorgon2D.dll
Syntax
public interface IGorgonSpriteCodec : IGorgonGraphicsObject, IGorgonNamedObject
Properties
| Edit this page View SourceCanDecode
Property to return whether or not the codec can decode sprite 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 sprite 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 this codec.
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 sprite data that the codec supports.
Declaration
Version Version { get; }
Property Value
Type | Description |
---|---|
Version |
See Also
Methods
| Edit this page View SourceFromFile(string, GorgonTexture2DView)
Function to read the sprite data from a file on the physical file system.
Declaration
GorgonSprite FromFile(string filePath, GorgonTexture2DView overrideTexture = null)
Parameters
Type | Name | Description |
---|---|---|
string | filePath | The path to the file to read. |
GorgonTexture2DView | overrideTexture | [Optional] The texture to use as an override for the sprite. |
Returns
Type | Description |
---|---|
GorgonSprite | A new GorgonSprite. |
See Also
| Edit this page View SourceFromStream(Stream, GorgonTexture2DView, int?)
Function to read the sprite data from a stream.
Declaration
GorgonSprite FromStream(Stream stream, GorgonTexture2DView overrideTexture = null, int? byteCount = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream containing the sprite. |
GorgonTexture2DView | overrideTexture | [Optional] The texture to use as an override for the sprite. |
int? | byteCount | [Optional] The number of bytes to read from the stream. |
Returns
Type | Description |
---|---|
GorgonSprite | A new GorgonSprite. |
See Also
| Edit this page View SourceGetAssociatedTextureName(Stream)
Function to retrieve the name of the associated texture.
Declaration
string GetAssociatedTextureName(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream containing the texture data. |
Returns
Type | Description |
---|---|
string | The name of the texture associated with the sprite, or null if no texture was 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. |
See Also
| Edit this page View SourceSave(GorgonSprite, Stream)
Function to save the sprite data to a stream.
Declaration
void Save(GorgonSprite sprite, Stream stream)
Parameters
Type | Name | Description |
---|---|---|
GorgonSprite | sprite | The sprite to serialize into the stream. |
Stream | stream | The stream that will contain the sprite. |
See Also
| Edit this page View SourceSave(GorgonSprite, string)
Function to save the sprite data to a file on a physical file system.
Declaration
void Save(GorgonSprite sprite, string filePath)
Parameters
Type | Name | Description |
---|---|---|
GorgonSprite | sprite | The sprite to serialize into the file. |
string | filePath | The path to the file. |