Gorgon
Show / Hide Table of Contents

Interface IGorgonPolySpriteCodec

An interface used to serialize and deserialize GorgonPolySprite objects.

Inherited Members
IGorgonGraphicsObject.Graphics
IGorgonNamedObject.Name
Namespace: Gorgon.IO
Assembly: Gorgon.IO.Gorgon2D.dll
Syntax
public interface IGorgonPolySpriteCodec : IGorgonGraphicsObject, IGorgonNamedObject

Properties

| Edit this page View Source

CanDecode

Property to return whether or not the codec can decode sprite data.

Declaration
bool CanDecode { get; }
Property Value
Type Description
bool
See Also
GorgonPolySprite
| Edit this page View Source

CanEncode

Property to return whether or not the codec can encode sprite data.

Declaration
bool CanEncode { get; }
Property Value
Type Description
bool
See Also
GorgonPolySprite
| Edit this page View Source

Codec

Property to return the abbreviated name of the codec (e.g. PNG).

Declaration
string Codec { get; }
Property Value
Type Description
string
See Also
GorgonPolySprite
| Edit this page View Source

CodecDescription

Property to return the friendly description of the format.

Declaration
string CodecDescription { get; }
Property Value
Type Description
string
See Also
GorgonPolySprite
| Edit this page View Source

FileExtensions

Property to return the common file extensions for a polygonal sprite.

Declaration
IReadOnlyList<GorgonFileExtension> FileExtensions { get; }
Property Value
Type Description
IReadOnlyList<GorgonFileExtension>
See Also
GorgonPolySprite
| Edit this page View Source

Renderer

Property to return the renderer used to create objects.

Declaration
Gorgon2D Renderer { get; }
Property Value
Type Description
Gorgon2D
See Also
GorgonPolySprite
| Edit this page View Source

Version

Property to return the version of sprite data that the codec supports.

Declaration
Version Version { get; }
Property Value
Type Description
Version
See Also
GorgonPolySprite

Methods

| Edit this page View Source

FromFile(string, GorgonTexture2DView)

Function to read the sprite data from a file on the physical file system.

Declaration
GorgonPolySprite 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
GorgonPolySprite

A new GorgonPolySprite.

See Also
GorgonPolySprite
| Edit this page View Source

FromStream(Stream, GorgonTexture2DView, int?)

Function to read the sprite data from a stream.

Declaration
GorgonPolySprite 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
GorgonPolySprite

A new GorgonPolySprite.

See Also
GorgonPolySprite
| Edit this page View Source

GetAssociatedTextureName(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
GorgonPolySprite
| Edit this page View Source

IsReadable(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
GorgonPolySprite
| Edit this page View Source

Save(GorgonPolySprite, Stream)

Function to save the sprite data to a stream.

Declaration
void Save(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.

See Also
GorgonPolySprite
| Edit this page View Source

Save(GorgonPolySprite, string)

Function to save the sprite data to a file on a physical file system.

Declaration
void Save(GorgonPolySprite sprite, string filePath)
Parameters
Type Name Description
GorgonPolySprite sprite

The sprite to serialize into the file.

string filePath

The path to the file.

See Also
GorgonPolySprite

Extension Methods

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

See Also

GorgonPolySprite
  • 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