TGUI  v0.5.2
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Public Member Functions | List of all members
tgui::SpriteSheet Struct Reference

Load one big image and split it into smaller images so that you can display tiles or play an animation. More...

#include <SpriteSheet.hpp>

Inheritance diagram for tgui::SpriteSheet:
tgui::Picture tgui::OBJECT

Public Member Functions

 SpriteSheet ()
 Default constructor. More...
 
 SpriteSheet (const SpriteSheet &copy)
 Copy constructor. More...
 
SpriteSheetoperator= (const SpriteSheet &right)
 Overload of assignment operator. More...
 
virtual void setSize (float width, float height)
 Changes the size of the picture cell, so the piece that is shown. More...
 
virtual Vector2u getSize () const
 Returns the size of a picture cell, so the piece that is shown, unaffected by scaling. More...
 
virtual Vector2f getScaledSize () const
 Returns the size of a picture cell, so the piece that is shown, after the scaling transformation. More...
 
virtual void setCells (unsigned int rows, unsigned int columns)
 Change the number of rows and columns in the image. More...
 
virtual void setRows (unsigned int rows)
 Change the number of rows in the image. More...
 
virtual unsigned int getRows () const
 Returns the number of rows in the image. More...
 
virtual void setColumns (unsigned int columns)
 Change the number of columns in the image. More...
 
virtual unsigned int getColumns () const
 Returns the number of columns in the image. More...
 
virtual void setVisibleCell (unsigned int row, unsigned int column)
 Choose which cell should be displayed. More...
 
virtual sf::Vector2u getVisibleCell () const
 Returns which cell is being displayed. More...
 
- Public Member Functions inherited from tgui::Picture
 Picture ()
 Default constructor. More...
 
 Picture (const Picture &copy)
 Copy constructor. More...
 
virtual ~Picture ()
 Destructor. More...
 
Pictureoperator= (const Picture &right)
 Overload of assignment operator. More...
 
virtual bool load (const std::string &filename)
 Load an image from a file. More...
 
virtual std::string getLoadedFilename () const
 Returns the filename that was used to load the picture. More...
 
- Public Member Functions inherited from tgui::OBJECT
 OBJECT ()
 Default constructor. More...
 
 OBJECT (const OBJECT &copy)
 Copy constructor. More...
 
virtual ~OBJECT ()
 Destructor. More...
 
OBJECToperator= (const OBJECT &right)
 Overload of assignment operator. More...
 
virtual void show ()
 Shows the object. More...
 
virtual void hide ()
 Hides the object. More...
 
virtual bool isVisible () const
 Returns true when the object is visible. More...
 
virtual void enable ()
 Enables the object. More...
 
virtual void disable ()
 Disables the object. More...
 
virtual bool isEnabled () const
 Returns true when the object is enabled. More...
 
virtual bool isDisabled () const
 Returns true when the object is disabled. More...
 
virtual bool isLoaded () const
 Returns true when the object is loaded successfully. More...
 
void focus ()
 Focus the object. More...
 
void unfocus ()
 Unfocus the object. More...
 
void focusNextObject ()
 Focuses the next object. More...
 
virtual bool isFocused () const
 Returns true when the object is focused and false otherwise. More...
 
virtual ObjectTypes getObjectType () const
 Returns the type of the object. More...
 
virtual void moveToFront ()
 Places the object before all other objects. More...
 
virtual void moveToBack ()
 Places the object behind all other objects. More...
 

Detailed Description

Load one big image and split it into smaller images so that you can display tiles or play an animation.

Constructor & Destructor Documentation

tgui::SpriteSheet::SpriteSheet ( )

Default constructor.

tgui::SpriteSheet::SpriteSheet ( const SpriteSheet copy)

Copy constructor.

Member Function Documentation

virtual unsigned int tgui::SpriteSheet::getColumns ( ) const
virtual

Returns the number of columns in the image.

virtual unsigned int tgui::SpriteSheet::getRows ( ) const
virtual

Returns the number of rows in the image.

virtual Vector2f tgui::SpriteSheet::getScaledSize ( ) const
virtual

Returns the size of a picture cell, so the piece that is shown, after the scaling transformation.

Reimplemented from tgui::Picture.

virtual Vector2u tgui::SpriteSheet::getSize ( ) const
virtual

Returns the size of a picture cell, so the piece that is shown, unaffected by scaling.

Reimplemented from tgui::Picture.

virtual sf::Vector2u tgui::SpriteSheet::getVisibleCell ( ) const
virtual

Returns which cell is being displayed.

SpriteSheet& tgui::SpriteSheet::operator= ( const SpriteSheet right)

Overload of assignment operator.

virtual void tgui::SpriteSheet::setCells ( unsigned int  rows,
unsigned int  columns 
)
virtual

Change the number of rows and columns in the image.

virtual void tgui::SpriteSheet::setColumns ( unsigned int  columns)
virtual

Change the number of columns in the image.

virtual void tgui::SpriteSheet::setRows ( unsigned int  rows)
virtual

Change the number of rows in the image.

virtual void tgui::SpriteSheet::setSize ( float  width,
float  height 
)
virtual

Changes the size of the picture cell, so the piece that is shown.

Parameters
widthThe new width of the picture cell.
heightThe new height of the picture cell.

Reimplemented from tgui::Picture.

virtual void tgui::SpriteSheet::setVisibleCell ( unsigned int  row,
unsigned int  column 
)
virtual

Choose which cell should be displayed.


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