Gorgon
Show / Hide Table of Contents

Class GorgonSpriteExtensions

Extension methods for the GorgonSprite object.

Inheritance
object
GorgonSpriteExtensions
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Gorgon.Renderers
Assembly: Gorgon.IO.Gorgon2D.dll
Syntax
public static class GorgonSpriteExtensions

Methods

| Edit this page View Source

ToJson(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 sprite parameter is null.

See Also
GorgonPolySprite
| Edit this page View Source

ToJson(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 sprite parameter is null.

See Also
GorgonSprite
  • 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