Daikon Forge GUI  v1.0.16
Daikon Forge user interface library for Unity
 All Classes Functions Variables Enumerations Enumerator Properties Events Pages
dfAtlas Class Reference

Implements a Texture Atlas (also known as a Sprite Sheet) which will be used by dfSprite and derived classes to display textures on-screen while requiring a minimum number of draw calls. See this NVIDIA whitepaper for a complete overview of texture atlas use and benefits. More...

Inheritance diagram for dfAtlas:

Detailed Description

Implements a Texture Atlas (also known as a Sprite Sheet) which will be used by dfSprite and derived classes to display textures on-screen while requiring a minimum number of draw calls. See this NVIDIA whitepaper for a complete overview of texture atlas use and benefits.

Public Types

enum  TextureAtlasGenerator { TextureAtlasGenerator.Internal, TextureAtlasGenerator.TexturePacker }
 Specifies which program or library was used to generate the texture atlas More...
 

Nested Classes

class  ItemInfo
 Encapsulates the information needed to render a single sprite from the Texture Atlas More...
 

Public Member Functions

void AddItem (ItemInfo item)
 Add a new sprite to the Texture Atlas More...
 
void AddItems (IEnumerable< ItemInfo > list)
 Add a collection of sprites to the Texture Atlas More...
 
void RebuildIndexes ()
 Rebuilds the runtime indexes that the dfAtlas class uses to speed up lookups. More...
 
void Remove (string name)
 Remove the named sprite from the Texture Atlas More...
 

Public Attributes

string dataFileGUID = null
 Represents the Asset GUID for the data file that was imported to create the texture atlas. This value will only be set when the texture atlas was imported from another program or format. More...
 
TextureAtlasGenerator generator = TextureAtlasGenerator.Internal
 Represents the program or library that was used to generate the texture atlas More...
 
string imageFileGUID = null
 Represents the Asset GUID for the image file that was imported to create the texture atlas. This value will only be set when the texture atlas was imported from another program or format. More...
 

Properties

int Count [get]
 Returns the number of sprites available in this Texture Atlas More...
 
List< ItemInfoItems [get]
 Returns the list of sprites defined in this Texture Atlas More...
 
Material Material [get, set]
 Returns a reference to the Material that will be used to render sprites in this Texture Atlas More...
 
dfAtlas Replacement [get, set]
 Gets or sets a replacement atlas, allowing requests from sprites in this atlas to be forwarded to the replacement. More...
 
Texture2D Texture [get]
 The Texture2D instance containing all of the sprites in this Texture Atlas More...
 
ItemInfo this[string key] [get]
 Retrieves sprite information by searching by sprite name More...
 

Member Enumeration Documentation

Specifies which program or library was used to generate the texture atlas

Enumerator
Internal 

The texture atlas was generated by this library

TexturePacker 

The texture atlas was imported from TexturePacker

Member Function Documentation

void dfAtlas.AddItem ( ItemInfo  item)

Add a new sprite to the Texture Atlas

Parameters
itemThe sprite data to be stored
void dfAtlas.AddItems ( IEnumerable< ItemInfo list)

Add a collection of sprites to the Texture Atlas

Parameters
listThe sprite data to be stored
void dfAtlas.RebuildIndexes ( )

Rebuilds the runtime indexes that the dfAtlas class uses to speed up lookups.

void dfAtlas.Remove ( string  name)

Remove the named sprite from the Texture Atlas

Parameters
nameThe name of the sprite to be removed

Property Documentation

int dfAtlas.Count
get

Returns the number of sprites available in this Texture Atlas

List<ItemInfo> dfAtlas.Items
get

Returns the list of sprites defined in this Texture Atlas

Material dfAtlas.Material
getset

Returns a reference to the Material that will be used to render sprites in this Texture Atlas

dfAtlas dfAtlas.Replacement
getset

Gets or sets a replacement atlas, allowing requests from sprites in this atlas to be forwarded to the replacement.

Texture2D dfAtlas.Texture
get

The Texture2D instance containing all of the sprites in this Texture Atlas

ItemInfo dfAtlas.this[string key]
get

Retrieves sprite information by searching by sprite name

Parameters
keyThe name of the sprite to be returned
Returns
An ItemInfo instance representing the desired sprite, if found. NULL otherwise