Irrlicht 3D Engine
IGUISpriteBank.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2012 Nikolaus Gebhardt
2 // This file is part of the "Irrlicht Engine".
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
4 
5 #ifndef __I_GUI_SPRITE_BANK_H_INCLUDED__
6 #define __I_GUI_SPRITE_BANK_H_INCLUDED__
7 
8 #include "IReferenceCounted.h"
9 #include "irrArray.h"
10 #include "SColor.h"
11 #include "rect.h"
12 
13 namespace irr
14 {
15 
16 namespace video
17 {
18  class ITexture;
19 } // end namespace video
20 
21 namespace gui
22 {
23 
26 {
29 };
30 
32 struct SGUISprite
33 {
35 
38 };
39 
40 
42 
45 class IGUISpriteBank : public virtual IReferenceCounted
46 {
47 public:
48 
51 
54 
56  virtual u32 getTextureCount() const = 0;
57 
59  virtual video::ITexture* getTexture(u32 index) const = 0;
60 
62  virtual void addTexture(video::ITexture* texture) = 0;
63 
65  virtual void setTexture(u32 index, video::ITexture* texture) = 0;
66 
70  virtual s32 addTextureAsSprite(video::ITexture* texture) = 0;
71 
73  virtual void clear() = 0;
74 
76  virtual void draw2DSprite(u32 index, const core::position2di& pos,
77  const core::rect<s32>* clip=0,
78  const video::SColor& color= video::SColor(255,255,255,255),
79  u32 starttime=0, u32 currenttime=0,
80  bool loop=true, bool center=false) = 0;
81 
83  virtual void draw2DSpriteBatch(const core::array<u32>& indices, const core::array<core::position2di>& pos,
84  const core::rect<s32>* clip=0,
85  const video::SColor& color= video::SColor(255,255,255,255),
86  u32 starttime=0, u32 currenttime=0,
87  bool loop=true, bool center=false) = 0;
88 };
89 
90 
91 } // end namespace gui
92 } // end namespace irr
93 
94 #endif // __I_GUI_SPRITE_BANK_H_INCLUDED__
95 
irr::gui::SGUISpriteFrame::textureNumber
u32 textureNumber
Definition: IGUISpriteBank.h:27
irr::gui::SGUISprite::Frames
core::array< SGUISpriteFrame > Frames
Definition: IGUISpriteBank.h:36
irr::gui::IGUISpriteBank::draw2DSprite
virtual void draw2DSprite(u32 index, const core::position2di &pos, const core::rect< s32 > *clip=0, const video::SColor &color=video::SColor(255, 255, 255, 255), u32 starttime=0, u32 currenttime=0, bool loop=true, bool center=false)=0
Draws a sprite in 2d with position and color.
irr::gui::SGUISprite
A sprite composed of several frames.
Definition: IGUISpriteBank.h:32
irr::gui::IGUISpriteBank
Sprite bank interface.
Definition: IGUISpriteBank.h:45
IReferenceCounted.h
irr::video::ITexture
Interface of a Video Driver dependent Texture.
Definition: ITexture.h:98
irr::gui::IGUISpriteBank::setTexture
virtual void setTexture(u32 index, video::ITexture *texture)=0
Changes one of the textures in the sprite bank.
irr::core::vector2d
2d vector template class with lots of operators and methods.
Definition: dimension2d.h:16
irr::s32
signed int s32
32 bit signed variable.
Definition: irrTypes.h:66
irr::gui::IGUISpriteBank::addTexture
virtual void addTexture(video::ITexture *texture)=0
Adds a texture to the sprite bank.
irrArray.h
irr::gui::IGUISpriteBank::getSprites
virtual core::array< SGUISprite > & getSprites()=0
Returns the array of animated sprites within the sprite bank.
irr::gui::IGUISpriteBank::draw2DSpriteBatch
virtual void draw2DSpriteBatch(const core::array< u32 > &indices, const core::array< core::position2di > &pos, const core::rect< s32 > *clip=0, const video::SColor &color=video::SColor(255, 255, 255, 255), u32 starttime=0, u32 currenttime=0, bool loop=true, bool center=false)=0
Draws a sprite batch in 2d using an array of positions and a color.
irr::IReferenceCounted
Base class of most objects of the Irrlicht Engine.
Definition: IReferenceCounted.h:41
irr::gui::SGUISprite::SGUISprite
SGUISprite()
Definition: IGUISpriteBank.h:34
irr::gui::IGUISpriteBank::getTexture
virtual video::ITexture * getTexture(u32 index) const =0
Gets the texture with the specified index.
irr::gui::IGUISpriteBank::clear
virtual void clear()=0
clears sprites, rectangles and textures
irr::gui::SGUISpriteFrame::rectNumber
u32 rectNumber
Definition: IGUISpriteBank.h:28
irr
Everything in the Irrlicht Engine can be found in this namespace.
Definition: aabbox3d.h:12
irr::core::rect< s32 >
rect.h
irr::u32
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:58
irr::gui::IGUISpriteBank::getTextureCount
virtual u32 getTextureCount() const =0
Returns the number of textures held by the sprite bank.
irr::core::array
Self reallocating template array (like stl vector) with additional features.
Definition: irrArray.h:22
irr::gui::SGUISprite::frameTime
u32 frameTime
Definition: IGUISpriteBank.h:37
irr::gui::SGUISpriteFrame
A single sprite frame.
Definition: IGUISpriteBank.h:25
irr::video::SColor
Class representing a 32 bit ARGB color.
Definition: SColor.h:201
irr::gui::IGUISpriteBank::getPositions
virtual core::array< core::rect< s32 > > & getPositions()=0
Returns the list of rectangles held by the sprite bank.
irr::gui::IGUISpriteBank::addTextureAsSprite
virtual s32 addTextureAsSprite(video::ITexture *texture)=0
SColor.h