Loading...
Searching...
No Matches
IGUISpriteBank.h
Go to the documentation of this file.
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_GUI_SPRITE_BANK_H_INCLUDED__
#define __I_GUI_SPRITE_BANK_H_INCLUDED__
#include "IReferenceCounted.h"
#include "irrArray.h"
#include "SColor.h"
#include "rect.h"
namespace irr
{
namespace video
{
class ITexture;
} // end namespace video
namespace gui
{
struct SGUISpriteFrame
{
u32 textureNumber;
u32 rectNumber;
};
struct SGUISprite
{
SGUISprite() : Frames(), frameTime(0) {}
core::array<SGUISpriteFrame> Frames;
u32 frameTime;
};
class IGUISpriteBank : public virtual IReferenceCounted
{
public:
virtual core::array< core::rect<s32> >& getPositions() = 0;
virtual core::array< SGUISprite >& getSprites() = 0;
virtual u32 getTextureCount() const = 0;
virtual video::ITexture* getTexture(u32 index) const = 0;
virtual void addTexture(video::ITexture* texture) = 0;
virtual void setTexture(u32 index, video::ITexture* texture) = 0;
virtual s32 addTextureAsSprite(video::ITexture* texture) = 0;
virtual void clear() = 0;
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;
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;
};
} // end namespace gui
} // end namespace irr
#endif // __I_GUI_SPRITE_BANK_H_INCLUDED__
IReferenceCounted.h
SColor.h
irr::IReferenceCounted::IReferenceCounted
IReferenceCounted()
Constructor.
Definition IReferenceCounted.h:46
irr::core::array
Self reallocating template array (like stl vector) with additional features.
Definition irrArray.h:23
irr::core::rect
Rectangle template.
Definition rect.h:27
irr::gui::IGUISpriteBank
Sprite bank interface.
Definition IGUISpriteBank.h:46
irr::gui::IGUISpriteBank::setTexture
virtual void setTexture(u32 index, video::ITexture *texture)=0
Changes one of the textures in the sprite bank.
irr::gui::IGUISpriteBank::clear
virtual void clear()=0
clears sprites, rectangles and textures
irr::gui::IGUISpriteBank::getSprites
virtual core::array< SGUISprite > & getSprites()=0
Returns the array of animated sprites within the sprite bank.
irr::gui::IGUISpriteBank::addTextureAsSprite
virtual s32 addTextureAsSprite(video::ITexture *texture)=0
irr::gui::IGUISpriteBank::getTextureCount
virtual u32 getTextureCount() const =0
Returns the number of textures held by the sprite bank.
irr::gui::IGUISpriteBank::getTexture
virtual video::ITexture * getTexture(u32 index) const =0
Gets the texture with the specified index.
irr::gui::IGUISpriteBank::addTexture
virtual void addTexture(video::ITexture *texture)=0
Adds a texture to 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::gui::IGUISpriteBank::getPositions
virtual core::array< core::rect< s32 > > & getPositions()=0
Returns the list of rectangles held by the sprite bank.
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::video::ITexture
Interface of a Video Driver dependent Texture.
Definition ITexture.h:99
irr::video::SColor
Class representing a 32 bit ARGB color.
Definition SColor.h:202
irrArray.h
irr::core::position2di
vector2d< s32 > position2di
Definition position2d.h:24
irr::gui
The gui namespace contains useful classes for easy creation of a graphical user interface.
Definition EGUIAlignment.h:11
irr::video
The video namespace contains classes for accessing the video driver. All 2d and 3d rendering is done ...
Definition EDriverFeatures.h:11
irr
Everything in the Irrlicht Engine can be found in this namespace.
Definition aabbox3d.h:13
irr::u32
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.h:58
irr::s32
signed int s32
32 bit signed variable.
Definition irrTypes.h:66
rect.h
irr::gui::SGUISpriteFrame
A single sprite frame.
Definition IGUISpriteBank.h:26
irr::gui::SGUISpriteFrame::textureNumber
u32 textureNumber
Definition IGUISpriteBank.h:27
irr::gui::SGUISpriteFrame::rectNumber
u32 rectNumber
Definition IGUISpriteBank.h:28
irr::gui::SGUISprite::Frames
core::array< SGUISpriteFrame > Frames
Definition IGUISpriteBank.h:36
irr::gui::SGUISprite::frameTime
u32 frameTime
Definition IGUISpriteBank.h:37
irr::gui::SGUISprite::SGUISprite
SGUISprite()
Definition IGUISpriteBank.h:34
- Irrlicht Engine Documentation © 2003-2012 by Nikolaus Gebhardt. Generated on for Irrlicht 3D Engine by Doxygen 1.15.0