Semi Mod Loader
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
Semi.SpriteCollection Struct Reference

Wrapper struct for tk2dSpriteCollectionData that provides a cleaner interface and works transparently with anything that expects tk2dSpriteCollectionDatas. More...

Public Member Functions

void RefreshLookupDictionary ()
 Refreshes the lookup dictionary for definitions. Done automatically by AddDefinition/AddDefinitions. More...
 
void AddDefinition (SpriteDefinition def)
 Adds a single sprite definition to this collection. More...
 
void AddDefinitions (params SpriteDefinition[] defs)
 Adds multiple sprite definitions at once to this collection. More...
 
int GetIndex (string id)
 Gets the index of a sprite definition based on its ID. More...
 
SpriteDefinitionGetDefinition (string id)
 Gets a sprite definition based on its ID. More...
 

Static Public Member Functions

static implicit operator tk2dSpriteCollectionData (SpriteCollection s)
 Implicit cast operator that allows you to use SpriteCollection anywhere where t2kdSpriteCollectionData is expected. More...
 
static SpriteCollection Construct (GameObject parent, string name, string unique_id, Material material, params SpriteDefinition[] defs)
 Constructs a new sprite collection. More...
 
static SpriteCollection Load (Tk0dConfigParser.ParsedCollection parsed, string base_dir, string coll_namespace, Texture2D override_spritesheet=null)
 Load a Semi Collection format file from its parsed representation. The collection will be attached to the global modded sprite collection game object. More...
 

Public Attributes

tk2dSpriteCollectionData Wrap
 Real tk2d object. More...
 

Properties

ProxyList< SpriteDefinition, tk2dSpriteDefinition > SpriteDefinitions [get, set]
 The sprite definitions contained in this collection. More...
 
GameObject GameObject [get]
 The game object this collection is a component of. More...
 
string Name [get, set]
 Name of the sprite collection. More...
 
string GUID [get, set]
 Globally Unique ID of the sprite collection. More...
 
Material[] Materials [get, set]
 Array of materials. More...
 
Material[] MaterialInstances [get, set]
 Array of instances of materials. More...
 

Detailed Description

Wrapper struct for tk2dSpriteCollectionData that provides a cleaner interface and works transparently with anything that expects tk2dSpriteCollectionDatas.

Member Function Documentation

◆ AddDefinition()

void Semi.SpriteCollection.AddDefinition ( SpriteDefinition  def)

Adds a single sprite definition to this collection.

Parameters
defThe definition.

◆ AddDefinitions()

void Semi.SpriteCollection.AddDefinitions ( params SpriteDefinition[]  defs)
inline

Adds multiple sprite definitions at once to this collection.

Parameters
defsThe array of definitions.

◆ Construct()

static SpriteCollection Semi.SpriteCollection.Construct ( GameObject  parent,
string  name,
string  unique_id,
Material  material,
params SpriteDefinition[]  defs 
)
inlinestatic

Constructs a new sprite collection.

Returns
The new sprite collection.
Parameters
parentGameObject to add this collection to.
nameName.
unique_idUnique identifier.
materialMaterial.
defsOptional array of preset definitions.

◆ GetDefinition()

SpriteDefinition? Semi.SpriteCollection.GetDefinition ( string  id)
inline

Gets a sprite definition based on its ID.

Returns
The sprite definition with this ID or null if it doesn't exist.
Parameters
idThe ID of the definition.

◆ GetIndex()

int Semi.SpriteCollection.GetIndex ( string  id)
inline

Gets the index of a sprite definition based on its ID.

Returns
The index of the sprite definition or a value less than 0 if not found.
Parameters
idThe ID of the sprite definition.

◆ Load()

static SpriteCollection Semi.SpriteCollection.Load ( Tk0dConfigParser.ParsedCollection  parsed,
string  base_dir,
string  coll_namespace,
Texture2D  override_spritesheet = null 
)
inlinestatic

Load a Semi Collection format file from its parsed representation. The collection will be attached to the global modded sprite collection game object.

Returns
The new sprite collection.
Parameters
parsedParsed representation of the Semi Collection.
base_dirBase directory to load referenced assets from.
coll_namespaceNamespace to use for the collection and the definitions.

◆ operator tk2dSpriteCollectionData()

static implicit Semi.SpriteCollection.operator tk2dSpriteCollectionData ( SpriteCollection  s)
static

Implicit cast operator that allows you to use SpriteCollection anywhere where t2kdSpriteCollectionData is expected.

◆ RefreshLookupDictionary()

void Semi.SpriteCollection.RefreshLookupDictionary ( )
inline

Refreshes the lookup dictionary for definitions. Done automatically by AddDefinition/AddDefinitions.

Member Data Documentation

◆ Wrap

tk2dSpriteCollectionData Semi.SpriteCollection.Wrap

Real tk2d object.

Property Documentation

◆ GameObject

GameObject Semi.SpriteCollection.GameObject
get

The game object this collection is a component of.

◆ GUID

string Semi.SpriteCollection.GUID
getset

Globally Unique ID of the sprite collection.

◆ MaterialInstances

Material [] Semi.SpriteCollection.MaterialInstances
getset

Array of instances of materials.

◆ Materials

Material [] Semi.SpriteCollection.Materials
getset

Array of materials.

◆ Name

string Semi.SpriteCollection.Name
getset

Name of the sprite collection.

◆ SpriteDefinitions

ProxyList<SpriteDefinition, tk2dSpriteDefinition> Semi.SpriteCollection.SpriteDefinitions
getset

The sprite definitions contained in this collection.


The documentation for this struct was generated from the following file: