TextureInfo Class Reference

TextureInfo holds a Texture2D object and caches associated tile UV data. More...

List of all members.

Classes

class  CachedTileData
 Cached UV information for each tile. More...

Public Member Functions

CachedTileData GetCachedTiledData (ref Vector2i tile_index)
 Return the CachedTileData (which contains tile UV information) for a given tile.
 TextureInfo ()
 TextureInfo constructor.
 TextureInfo (string filename)
 TextureInfo constructor.
 TextureInfo (Texture2D texture)
 TextureInfo constructor.
 TextureInfo (Texture2D texture, Vector2i num_tiles)
 TextureInfo constructor.
 TextureInfo (Texture2D texture, Vector2i num_tiles, TRS source_area)
 TextureInfo constructor.
void Dispose ()
 Dispose implementation.
void Initialize (Texture2D texture, Vector2i num_tiles, TRS source_area)
 The actual init function called by TextureInfo constructors.

Public Attributes

Texture2D Texture
 The texture object.
Vector2 TileSizeInUV
 Return tile size in uv units.
Vector2i NumTiles
 Return the dimensions of the tiles grid.

Properties

Vector2 TextureSizef [get]
 Return texture size in pixels as a Vector2.
Vector2i TextureSizei [get]
 Return texture size in pixels as a Vector2i.
Vector2 TileSizeInPixelsf [get]
 Return tile size in pixels as a Vector2.
bool Disposed [get]
 Return true if this object been disposed.

Detailed Description

TextureInfo holds a Texture2D object and caches associated tile UV data.

The source region for tiling is not necesseraly the entire texture, it can be any oriented box in UV domain. TextureInfo takes ownership of the Texture2D object passed to it, and disposes of it in its Dispose function.


Constructor & Destructor Documentation

TextureInfo ( Texture2D  texture)

TextureInfo constructor.

Note: TextureInfo takes ownership of the Texture2D passed to this constructor, and disposes of it in Dispose.

TextureInfo ( Texture2D  texture,
Vector2i  num_tiles 
)

TextureInfo constructor.

Note: TextureInfo takes ownership of the Texture2D passed to this constructor, and disposes of it in Dispose.

Parameters:
textureThe source texture.
num_tilesThe number of tile subdivisions on x and y.
TextureInfo ( Texture2D  texture,
Vector2i  num_tiles,
TRS  source_area 
)

TextureInfo constructor.

Note: TextureInfo takes ownership of the Texture2D passed to this constructor, and disposes of it in Dispose.

Parameters:
textureThe source texture.
num_tilesThe number of tile subdivisions on x and y.
source_areaThe source rectangle, in UV domain, on which we are going to build the tiles (bottom left is 0,0).

Member Function Documentation

void Initialize ( Texture2D  texture,
Vector2i  num_tiles,
TRS  source_area 
)

The actual init function called by TextureInfo constructors.

Parameters:
textureThe source texture.
num_tilesThe number of tiles/cells, horitonally and vertically.
source_areaThe source rectangle, in UV domain, on which we are going to build the tiles (bottom left is 0,0).

Property Documentation

Vector2 TileSizeInPixelsf [get]

Return tile size in pixels as a Vector2.

All tiles have the same size.