TGUI  v0.5.2
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
SpriteSheet.hpp
1 //
3 // TGUI - Texus's Graphical User Interface
4 // Copyright (C) 2012 Bruno Van de Velde (VDV_B@hotmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24 
25 
26 #ifndef _TGUI_SPRITE_SHEET_INCLUDED_
27 #define _TGUI_SPRITE_SHEET_INCLUDED_
28 
30 
31 namespace tgui
32 {
36  struct TGUI_API SpriteSheet : public Picture
37  {
41  SpriteSheet();
42 
43 
47  SpriteSheet(const SpriteSheet& copy);
48 
49 
53  SpriteSheet& operator= (const SpriteSheet& right);
54 
55 
59  virtual SpriteSheet* clone();
60 
61 
69  virtual void setSize(float width, float height);
70 
71 
75  virtual Vector2u getSize() const;
76 
77 
81  virtual Vector2f getScaledSize() const;
82 
83 
87  virtual void setCells(unsigned int rows, unsigned int columns);
88 
89 
93  virtual void setRows(unsigned int rows);
94 
95 
99  virtual unsigned int getRows() const;
100 
101 
105  virtual void setColumns(unsigned int columns);
106 
107 
111  virtual unsigned int getColumns() const;
112 
113 
117  virtual void setVisibleCell(unsigned int row, unsigned int column);
118 
119 
123  virtual sf::Vector2u getVisibleCell() const;
124 
125 
127  protected:
128 
129  unsigned int m_Rows;
130  unsigned int m_Columns;
131 
132  sf::Vector2u m_VisibleCell;
133  };
134 
136 }
137 
139 
140 #endif //_TGUI_SPRITE_SHEET_INCLUDED_
141 
Definition: Picture.hpp:35
Load one big image and split it into smaller images so that you can display tiles or play an animatio...
Definition: SpriteSheet.hpp:36