TurtleBrains  0.2.1
High quality, portable, C++ API for native application and game development.
TurtleBrains::Graphics Namespace Reference

Give the GameScene and Entities something to display, Text, Sprites and AnimatedSprites help bring the world to life. More...

Classes

class  AnimatedSprite
 
class  AnimationSequence
 
class  Color
 
class  Graphic
 
class  GraphicList
 
class  Sprite
 
struct  SpriteFrame
 
class  SpriteManager
 
class  SpriteMap
 
class  SpriteSheet
 
class  Text
 
class  TextureManager
 

Typedefs

typedef float TexelSpace
 
typedef tbCore::uint16 PixelSpace
 
typedef unsigned int TextureHandle
 

Enumerations

enum  AnchorLocation {
  kAnchorCenter = 0, kAnchorTopLeft, kAnchorTopCenter, kAnchorTopRight,
  kAnchorCenterLeft, kAnchorCenterRight, kAnchorBottomLeft, kAnchorBottomCenter,
  kAnchorBottomRight
}
 

Variables

SpriteManager theSpriteManager
 
const TextureHandle kInvalidTexture
 
TextureManager theTextureManager
 

Detailed Description

TODO: TIM : Documentation: This is still early in development and the Graphics framework is still being designed.

Typedef Documentation

Represents a measurement in pixel space be it the width/height of an image in pixels, or the location on the screen or texture in pixels.

Represents a value from 0 to 1 in texture space for the width/height or location on a texture.

A TextureHandle is a unique value for each unique texture created with the TextureManager. Use the handle to access the textures properties and to destroy any resources associated.

TODO: TIM: Implementation: Maybe this should be a tiny class/object that automatically cleans up resources?

Enumeration Type Documentation

These locations are used in the Sprite::SetOrigin() which takes an AnchorLocation.

Enumerator
kAnchorCenter 

This anchor will set the origin to the center of the Sprite horizontally and vertically.

kAnchorTopLeft 

This anchor will set the origin to the top-left corner, effectively: SetOrigin(0.0f, 0.0f).

kAnchorTopCenter 

This anchor will set the origin to the top and horizontal center of the Sprite.

kAnchorTopRight 

This anchor will set the origin to the top and right most corner of the Sprite.

kAnchorCenterLeft 

This anchor will set the origin to the center vertically and left most edge of the Sprite.

kAnchorCenterRight 

This anchor will set the origin to the center vertically and right most edge of the Sprite.

kAnchorBottomLeft 

This anchor will set the origin to the bottom and left most corner of the Sprite.

kAnchorBottomCenter 

This anchor will set the origin to the bottom edge and horizontal center of the Sprite.

kAnchorBottomRight 

This anchor will set the origin to the bottom and right most corner of the Sprite.

Variable Documentation

const TextureHandle TurtleBrains::Graphics::kInvalidTexture

This is a constant value that represents a null/invalid texture handle.

SpriteManager TurtleBrains::Graphics::theSpriteManager

Instead of creating your own SpriteManager object, this is a way to access it as a singleton. This may turn into a pointer to the object, although the SpriteManager api will remain the same.

TextureManager TurtleBrains::Graphics::theTextureManager

Instead of creating your own TextureManager object, this is a way to access it as a singleton. This may turn into a pointer to the object, although the TextureManager api will remain the same.