MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Mezzanine::UI::TextureAtlas Class Reference
+ Collaboration diagram for Mezzanine::UI::TextureAtlas:

Public Types

typedef
FontDataContainer::const_iterator 
ConstFontDataIterator
 
typedef
SpriteContainer::const_iterator 
ConstSpriteIterator
 
typedef std::map< String,
FontData * > 
FontDataContainer
 
typedef FontDataContainer::iterator FontDataIterator
 
typedef std::map< String,
Sprite * > 
SpriteContainer
 
typedef SpriteContainer::iterator SpriteIterator
 

Public Member Functions

 TextureAtlas (const String &Name, const UInt32 &Width, const UInt32 &Height)
 Proceadural constructor. More...
 
 TextureAtlas (XML::Node &AtlasNode)
 XML constructor. More...
 
 ~TextureAtlas ()
 Class destructor.
 
Ogre::Pass * _Get2DPass () const
 Gets the 2D Material Pass for this TextureAtlas. More...
 
Ogre::Pass * _Get3DPass () const
 Gets the 3D Material Pass for this TextureAtlas. More...
 
Ogre::MaterialPtr _GetOrCreate2DMaterial ()
 Gets the 2D Material for this TextureAtlas, creating it also if neccessary. More...
 
Ogre::MaterialPtr _GetOrCreate3DMaterial ()
 Gets the 3D Material for this TextureAtlas, creating it also if neccessary. More...
 
Ogre::TexturePtr _GetTexture ()
 Gets the texture being used by this Atlas. More...
 
FontDataGetFont (const String &FontName) const
 Gets the set of Glyphs of the specified name. More...
 
FontDataContainer & GetFonts ()
 Gets the full listing of all the FontData instances in this TextureAtlas. More...
 
Real GetInvTextureCoordsX () const
 Gets the inverse size of the TextureAtlas on the X size. More...
 
Real GetInvTextureCoordsY () const
 Gets the inverse size of the TextureAtlas on the Y size. More...
 
const StringGetName () const
 Gets the name of this Texture Atlas. More...
 
SpriteGetSprite (const String &Name) const
 Gets a Sprite by name. More...
 
SpriteContainer & GetSprites ()
 Gets the full listing of all the Sprite's in this TextureAtlas. More...
 
Vector2 GetTextureSize () const
 Gets the size of the TextureAtlas. More...
 
Vector2 GetWhitePixel () const
 Gets the location of the WhitePixel on the TextureAtlas. More...
 
Real GetWhitePixelX () const
 Gets the X coordinate for the WhitePixel. More...
 
Real GetWhitePixelY () const
 Gets the Y coordinate for the WhitePixel. More...
 

Protected Member Functions

void Create2DMaterial ()
 Creates the material to be used by 2D interfaces with this Atlas.
 
void Create3DMaterial ()
 Creates the material to be used by 3D interfaces with this Atlas.
 
Ogre::MaterialPtr GetOrCreate2DMasterMaterial ()
 Gets or creates the 2D "template" or "master" material that is to be used to copy from for all Atlases.
 
Ogre::MaterialPtr GetOrCreate3DMasterMaterial ()
 Gets or creates the 3D "template" or "master" material that is to be used to copy from for all Atlases.
 
void ParseFonts (XML::Node &AtlasFontsNode)
 Parses the data for a font.
 
void ParseGlyphs (XML::Node &GlyphsNode, const Vector2 &Offset, FontData *GlyphD)
 Parses the glyphs section of the Texture Atlas.
 
void ParseKernings (XML::Node &KerningsNode, FontData *FontD)
 Parses the kerning section of the Texture Atlas.
 
void ParseSprites (XML::Node &AtlasSpritesNode)
 Parses the sprites section of the Texture Atlas.
 
void ParseTexture (XML::Node &AtlasTextureNode)
 Parses the texture section of the Texture Atlas.
 
void ParseVerticalOffsets (XML::Node &VerticalOffsetsNode, FontData *FontD)
 Parses the vertical offsets section of the Texture Atlas.
 

Protected Attributes

String AtlasName
 
FontDataContainer Fonts
 
Vector2 InverseTextureSize
 
SpriteContainer Sprites
 
TextureAtlasInternalDataTAID
 
Vector2 WhitePixel
 

Detailed Description

Definition at line 67 of file textureatlas.h.

Constructor & Destructor Documentation

Mezzanine::UI::TextureAtlas::TextureAtlas ( const String Name,
const UInt32 Width,
const UInt32 Height 
)

Proceadural constructor.

Parameters
NameThe name to be given to this Texture Atlas.
WidthThe width of the desired texture to create for this atlas.
HeightThe height of the desired texture to create for this atlas.
Todo:
This is just a starter code sample for proceadurally generated texture atlases. Not ready and needs to be completed.

Definition at line 86 of file textureatlas.cpp.

Mezzanine::UI::TextureAtlas::TextureAtlas ( XML::Node AtlasNode)

XML constructor.

Parameters
AtlasNodeThe XML node containing all the information to create and configure this texture atlas.

Definition at line 97 of file textureatlas.cpp.

Member Function Documentation

Ogre::Pass * Mezzanine::UI::TextureAtlas::_Get2DPass ( ) const

Gets the 2D Material Pass for this TextureAtlas.

Returns
Returns a pointer to the 2D Pass used for this TextureAtlas.

Definition at line 595 of file textureatlas.cpp.

Ogre::Pass * Mezzanine::UI::TextureAtlas::_Get3DPass ( ) const

Gets the 3D Material Pass for this TextureAtlas.

Returns
Returns a pointer to the 3D Pass used for this TextureAtlas.

Definition at line 598 of file textureatlas.cpp.

Ogre::MaterialPtr Mezzanine::UI::TextureAtlas::_GetOrCreate2DMaterial ( )

Gets the 2D Material for this TextureAtlas, creating it also if neccessary.

Returns
Returns a shared pointer to the internal material for this Atlas.

Definition at line 576 of file textureatlas.cpp.

Ogre::MaterialPtr Mezzanine::UI::TextureAtlas::_GetOrCreate3DMaterial ( )

Gets the 3D Material for this TextureAtlas, creating it also if neccessary.

Returns
Returns a shared pointer to the internal material for this Atlas.

Definition at line 584 of file textureatlas.cpp.

Ogre::TexturePtr Mezzanine::UI::TextureAtlas::_GetTexture ( )

Gets the texture being used by this Atlas.

Returns
Returns a shared pointer to the internal texture for this Atlas.

Definition at line 592 of file textureatlas.cpp.

FontData * Mezzanine::UI::TextureAtlas::GetFont ( const String FontName) const

Gets the set of Glyphs of the specified name.

Parameters
NameThe name of the font as specified in the MTA file.
Returns
Returns a pointer to the GlyphData containing all the Glyphs.

Definition at line 531 of file textureatlas.cpp.

TextureAtlas::FontDataContainer & Mezzanine::UI::TextureAtlas::GetFonts ( )

Gets the full listing of all the FontData instances in this TextureAtlas.

Returns
Returns a reference to the map storing all the FontData instances loaded for this TextureAtlas.

Definition at line 539 of file textureatlas.cpp.

Real Mezzanine::UI::TextureAtlas::GetInvTextureCoordsX ( ) const

Gets the inverse size of the TextureAtlas on the X size.

Returns
Returns a Real containing the inverse width of the TextureAtlas.

Definition at line 567 of file textureatlas.cpp.

Real Mezzanine::UI::TextureAtlas::GetInvTextureCoordsY ( ) const

Gets the inverse size of the TextureAtlas on the Y size.

Returns
Returns a Real containing the inverse height of the TextureAtlas.

Definition at line 570 of file textureatlas.cpp.

const String & Mezzanine::UI::TextureAtlas::GetName ( ) const

Gets the name of this Texture Atlas.

Returns
Returns a string containing the name of this Texture Atlas

Definition at line 523 of file textureatlas.cpp.

Sprite * Mezzanine::UI::TextureAtlas::GetSprite ( const String Name) const

Gets a Sprite by name.

Parameters
NameThe name of the Sprite to get.
Returns
Returns a pointer to the named Sprite.

Definition at line 544 of file textureatlas.cpp.

TextureAtlas::SpriteContainer & Mezzanine::UI::TextureAtlas::GetSprites ( )

Gets the full listing of all the Sprite's in this TextureAtlas.

Returns
Returns a reference to the map storing all the Sprite's loaded for this TextureAtlas.

Definition at line 552 of file textureatlas.cpp.

Vector2 Mezzanine::UI::TextureAtlas::GetTextureSize ( ) const

Gets the size of the TextureAtlas.

Returns
Returns a Vector2 with the size of this TextureAtlas.

Definition at line 564 of file textureatlas.cpp.

Vector2 Mezzanine::UI::TextureAtlas::GetWhitePixel ( ) const

Gets the location of the WhitePixel on the TextureAtlas.

Returns
Returns a Vector2 with the location of the WhitePixel.

Definition at line 555 of file textureatlas.cpp.

Real Mezzanine::UI::TextureAtlas::GetWhitePixelX ( ) const

Gets the X coordinate for the WhitePixel.

Returns
Returns a Real containing the X coordinate of the WhitePixel.

Definition at line 558 of file textureatlas.cpp.

Real Mezzanine::UI::TextureAtlas::GetWhitePixelY ( ) const

Gets the Y coordinate for the WhitePixel.

Returns
Returns a Real containing the Y coordinate of the WhitePixel.

Definition at line 561 of file textureatlas.cpp.


The documentation for this class was generated from the following files: