Class GorgonV3PolySpriteBinaryCodec
A codec that can read and write a binary formatted version of Gorgon v3 polygonal sprite data.
Inherited Members
Namespace: Gorgon.IO
Assembly: Gorgon.IO.Gorgon2D.dll
Syntax
public class GorgonV3PolySpriteBinaryCodec : GorgonPolySpriteCodecCommon, IGorgonPolySpriteCodec, IGorgonGraphicsObject, IGorgonNamedObject
Constructors
| Edit this page View SourceGorgonV3PolySpriteBinaryCodec(Gorgon2D)
Initializes a new instance of the GorgonV3PolySpriteBinaryCodec class.
Declaration
public GorgonV3PolySpriteBinaryCodec(Gorgon2D renderer)
Parameters
Type | Name | Description |
---|---|---|
Gorgon2D | renderer | The renderer used for resource handling. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
Fields
| Edit this page View SourceIndexData
The sprite data chunk ID.
Declaration
public static readonly ulong IndexData
Field Value
Type | Description |
---|---|
ulong |
SpriteData
The sprite data chunk ID.
Declaration
public static readonly ulong SpriteData
Field Value
Type | Description |
---|---|
ulong |
TextureData
The texture data chunk ID.
Declaration
public static readonly ulong TextureData
Field Value
Type | Description |
---|---|
ulong |
TextureSamplerData
The texture sampler data chunk ID.
Declaration
public static readonly ulong TextureSamplerData
Field Value
Type | Description |
---|---|
ulong |
VersionData
The version data chunk ID.
Declaration
public static readonly ulong VersionData
Field Value
Type | Description |
---|---|
ulong |
VertexData
The sprite data chunk ID.
Declaration
public static readonly ulong VertexData
Field Value
Type | Description |
---|---|
ulong |
Properties
| Edit this page View SourceCanDecode
Property to return whether or not the codec can decode sprite data.
Declaration
public override bool CanDecode { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceCanEncode
Property to return whether or not the codec can encode sprite data.
Declaration
public override bool CanEncode { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceVersion
Property to return the version of sprite data that the codec supports.
Declaration
public override Version Version { get; }
Property Value
Type | Description |
---|---|
Version |
Overrides
Methods
| Edit this page View SourceOnGetAssociatedTextureName(Stream)
Function to retrieve the name of the associated texture.
Declaration
protected override string OnGetAssociatedTextureName(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. |
Overrides
| Edit this page View SourceOnIsReadable(Stream)
Function to determine if the data in a stream is readable by this codec.
Declaration
protected override bool OnIsReadable(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. |
Overrides
| Edit this page View SourceOnReadFromStream(Stream, int, GorgonTexture2DView)
Function to read the sprite data from a stream.
Declaration
protected override GorgonPolySprite OnReadFromStream(Stream stream, int byteCount, GorgonTexture2DView overrideTexture)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream containing the sprite. |
int | byteCount | The number of bytes to read from the stream. |
GorgonTexture2DView | overrideTexture | The texture to assign to the sprite instead of the texture associated with the name stored in the file. |
Returns
Type | Description |
---|---|
GorgonPolySprite | A new GorgonPolySprite. |
Overrides
| Edit this page View SourceOnSaveToStream(GorgonPolySprite, Stream)
Function to save the sprite data to a stream.
Declaration
protected override void OnSaveToStream(GorgonPolySprite sprite, Stream stream)
Parameters
Type | Name | Description |
---|---|---|
GorgonPolySprite | sprite | The sprite to serialize into the stream. |
Stream | stream | The stream that will contain the sprite. |