Class GorgonSpriteExtensions
Extension methods for the GorgonSprite object.
Inherited Members
Namespace: Gorgon.Renderers
Assembly: Gorgon.IO.Gorgon2D.dll
Syntax
public static class GorgonSpriteExtensions
Methods
| Edit this page View SourceToJson(GorgonPolySprite, bool)
Function to convert a polygonal sprite into a JSON formatted string.
Declaration
public static string ToJson(this GorgonPolySprite sprite, bool prettyFormat = false)
Parameters
Type | Name | Description |
---|---|---|
GorgonPolySprite | sprite | The polygonal sprite to serialize. |
bool | prettyFormat | true to employ pretty formatting on the JSON string (increases size), false to compact the string. |
Returns
Type | Description |
---|---|
string | The polygonal sprite data as a JSON formatted string. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
See Also
| Edit this page View SourceToJson(GorgonSprite, bool)
Function to convert a sprite into a JSON formatted string.
Declaration
public static string ToJson(this GorgonSprite sprite, bool prettyFormat = false)
Parameters
Type | Name | Description |
---|---|---|
GorgonSprite | sprite | The sprite to serialize. |
bool | prettyFormat | true to employ pretty formatting on the JSON string (increases size), false to compact the string. |
Returns
Type | Description |
---|---|
string | The sprite data as a JSON formatted string. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |