tbx  0.7.3
Public Member Functions | List of all members
tbx::Sprite Class Referenceabstract

Common base class for the UserSprite and WimpSprite classes. More...

#include <sprite.h>

Inheritance diagram for tbx::Sprite:
tbx::Image tbx::UserSprite tbx::WimpSprite

Public Member Functions

virtual void plot (int x, int y) const
 Plot sprite to screen. More...
 
virtual void plot (const Point &pos) const
 Plot sprite to screen. More...
 
virtual void plot_raw (const Point &pos, int code=SPA_USE_MASK) const =0
 Plot sprite with no scaling or colour translation. More...
 
virtual void plot_scaled (const Point &pos, const ScaleFactors *sf, const TranslationTable *tt=0, int code=SPA_USE_MASK) const =0
 Plot sprite scaled. More...
 
virtual void plot_screen (const Point &pos, int code=SPA_USE_MASK) const =0
 Plot sprite to screen calculating the correct colour translation and scaling. More...
 
virtual void plot_raw (int x, int y, int code=SPA_USE_MASK) const =0
 Plot sprite with no scaling or colour translation. More...
 
virtual void plot_scaled (int x, int y, const ScaleFactors *sf, const TranslationTable *tt=0, int code=SPA_USE_MASK) const =0
 Plot sprite scaled. More...
 
virtual void plot_screen (int x, int y, int code=SPA_USE_MASK) const =0
 Plot sprite to screen calculating the correct colour translation and scaling. More...
 
virtual std::string name () const =0
 Get the name of the sprite. More...
 
virtual int area_id () const =0
 Return sprite area id used for calls that take an area pointer or a special value for WIMP/System areas.
 
virtual bool info (Size *pixel_size, int *mode=NULL, bool *mask=NULL) const =0
 Get information about the sprite. More...
 
Size size () const
 Return the size of the sprite. More...
 
int width () const
 Return the width of the sprite. More...
 
int height () const
 Return the height of the sprite. More...
 
Size pixel_size () const
 Get size of the sprite in pixels. More...
 
int mode () const
 Get the mode of the sprite. More...
 
bool has_mask () const
 Check if the sprite has a mask. More...
 
virtual void get_wimp_scale (ScaleFactors &factor) const =0
 Get the scale factors required to plot this sprite in the WIMP as its logical size. More...
 

Detailed Description

Common base class for the UserSprite and WimpSprite classes.

Member Function Documentation

virtual void tbx::Sprite::get_wimp_scale ( ScaleFactors factor) const
pure virtual

Get the scale factors required to plot this sprite in the WIMP as its logical size.

Parameters
factorscale factors updated with the correct value

Implemented in tbx::WimpSprite, and tbx::UserSprite.

bool tbx::Sprite::has_mask ( ) const
inline

Check if the sprite has a mask.

Returns
true if the sprite has a mask
int Sprite::height ( ) const

Return the height of the sprite.

Return height of sprite in OS Units.

Returns
height of the sprite in OS units
virtual bool tbx::Sprite::info ( Size pixel_size,
int *  mode = NULL,
bool *  mask = NULL 
) const
pure virtual

Get information about the sprite.

Parameters
pixel_sizepointer to Size to be updated with size of sprite in pixels
modepointer to integer to receive the sprite mode number or 0 (the default) not to return the mode
maskpointer to a boolean which will be set to true if the sprite has a mask or 0 (the default) not to return the mask
Returns
true if successfule

Implemented in tbx::WimpSprite, and tbx::UserSprite.

int tbx::Sprite::mode ( ) const
inline

Get the mode of the sprite.

Returns
the mode number the sprite is defined for
virtual std::string tbx::Sprite::name ( ) const
pure virtual

Get the name of the sprite.

Returns
the name of the sprite as a string

Implemented in tbx::WimpSprite, and tbx::UserSprite.

Size tbx::Sprite::pixel_size ( ) const
inline

Get size of the sprite in pixels.

Returns
size of the sprite in pixels
void Sprite::plot ( int  x,
int  y 
) const
virtual

Plot sprite to screen.

This is the image::plot override

Implements tbx::Image.

void Sprite::plot ( const Point pos) const
virtual

Plot sprite to screen.

This is the Image::plot override

Reimplemented from tbx::Image.

virtual void tbx::Sprite::plot_raw ( const Point pos,
int  code = SPA_USE_MASK 
) const
pure virtual

Plot sprite with no scaling or colour translation.

Parameters
posOS coordinates of bottom left of where to plot the sprite
codesprite_plot_action flags speficying how the sprite is combined with the screen (default SPA_USE_MASK)

Implemented in tbx::WimpSprite, and tbx::UserSprite.

virtual void tbx::Sprite::plot_raw ( int  x,
int  y,
int  code = SPA_USE_MASK 
) const
pure virtual

Plot sprite with no scaling or colour translation.

Parameters
xleft of destination to plot the sprite in OS coordinates
ybottom of destination to plot the sprite in OS coordinates
codesprite_plot_action flags

Implemented in tbx::WimpSprite, and tbx::UserSprite.

virtual void tbx::Sprite::plot_scaled ( const Point pos,
const ScaleFactors sf,
const TranslationTable tt = 0,
int  code = SPA_USE_MASK 
) const
pure virtual

Plot sprite scaled.

Parameters
posOS coordinates of bottom left of where to plot the sprite
sfScaleFactors used to scale the sprite
ttTranslation table for colours in plot, 0 (the default) means don't translate the colours
codesprite_plot_action flags speficying how the sprite is combined with the screen (default SPA_USE_MASK)

Implemented in tbx::WimpSprite, and tbx::UserSprite.

virtual void tbx::Sprite::plot_scaled ( int  x,
int  y,
const ScaleFactors sf,
const TranslationTable tt = 0,
int  code = SPA_USE_MASK 
) const
pure virtual

Plot sprite scaled.

Parameters
xleft of destination to plot the sprite in OS coordinates
ybottom of destination to plot the sprite in OS coordinates
sfScaleFactors used to scale the sprite
ttTranslation table for colours in plot, 0 (the default) means don't translate the colours
codesprite_plot_action flags speficying how the sprite is combined with the screen (default SPA_USE_MASK)

Implemented in tbx::WimpSprite, and tbx::UserSprite.

virtual void tbx::Sprite::plot_screen ( const Point pos,
int  code = SPA_USE_MASK 
) const
pure virtual

Plot sprite to screen calculating the correct colour translation and scaling.

Parameters
posOS coordinates of bottom left of where to plot the sprite
codesprite_plot_action flags speficying how the sprite is combined with the screen (default SPA_USE_MASK)

Implemented in tbx::WimpSprite, and tbx::UserSprite.

virtual void tbx::Sprite::plot_screen ( int  x,
int  y,
int  code = SPA_USE_MASK 
) const
pure virtual

Plot sprite to screen calculating the correct colour translation and scaling.

Parameters
xleft of destination to plot the sprite in OS coordinates
ybottom of destination to plot the sprite in OS coordinates
codesprite_plot_action flags speficying how the sprite is combined with the screen (default SPA_USE_MASK)

Implemented in tbx::WimpSprite, and tbx::UserSprite.

Size Sprite::size ( ) const

Return the size of the sprite.

Returns
size of the sprite in OS units
int Sprite::width ( ) const

Return the width of the sprite.

Return width of sprite in OS units.

Returns
width of the sprite in OS units

The documentation for this class was generated from the following files: