tbx
0.7.3
|
Class for handling sprites from the Wimp sprite pool. More...
#include <sprite.h>
Public Member Functions | |
WimpSprite (const std::string &sname) | |
Construct a WIMP sprite. More... | |
WimpSprite (const char *sname) | |
Construct a WIMP sprite. More... | |
WimpSprite (int file_type) | |
Construct a wimp sprite to represent the given file_type. More... | |
WimpSprite (int file_type, std::string leafname) | |
Construct a wimp sprite to represent the given file_type. More... | |
bool | exist () const |
Check if this sprite exists in the Wimp sprite area. | |
virtual void | plot_raw (const Point &pos, int code=SPA_USE_MASK) const |
Plot this sprite at the given position with no scaling or colour conversions. | |
virtual void | plot_scaled (const Point &pos, const ScaleFactors *sf, const TranslationTable *tt=NULL, int code=SPA_USE_MASK) const |
Plot this sprite scaled using the given colour translation. More... | |
virtual void | plot_screen (const Point &pos, int code=SPA_USE_MASK) const |
Plot sprite to screen. More... | |
virtual void | plot_raw (int x, int y, int code=SPA_USE_MASK) const |
Plot this sprite at the given position with no scaling or colour conversions. | |
virtual void | plot_scaled (int x, int y, const ScaleFactors *sf, const TranslationTable *tt=NULL, int code=SPA_USE_MASK) const |
Plot this sprite scaled using the given colour translation. More... | |
virtual void | plot_screen (int x, int y, int code=SPA_USE_MASK) const |
Plot sprite to screen. More... | |
virtual std::string | name () const |
Get the name of the sprite. More... | |
virtual bool | info (Size *pixel_size, int *mode=NULL, bool *mask=NULL) const |
Get information about the sprite. More... | |
virtual void | get_wimp_scale (ScaleFactors &factor) const |
Get the scale factors required to plot this sprite in the WIMP as its logical size. More... | |
virtual int | area_id () const |
Return sprite area id used for calls that take an area pointer or a special value for WIMP/System areas. More... | |
bool | has_palette () const |
Check if WimpSprite is using a palette. | |
![]() | |
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... | |
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... | |
Class for handling sprites from the Wimp sprite pool.
These sprites are read only so just have functions for getting information and plotting a sprite.
|
inline |
Construct a WIMP sprite.
There is no check on the name given here. If it is incorrect the other sprite operations will fail silently.
Call the exist function to check if a sprite is currently in the WIMP sprite pool.
sname | of sprite in to reference |
|
inline |
Construct a WIMP sprite.
There is no check on the name given here. If it is incorrect the other sprite operations will fail silently.
Call the exist function to check if a sprite is currently in the WIMP sprite pool.
sname | of sprite in to reference |
WimpSprite::WimpSprite | ( | int | file_type | ) |
Construct a wimp sprite to represent the given file_type.
Applications will be given the generic file type.
If the sprite is not in the current wimp sprite pool unknown will be used.
file_type | file type to construct sprite for |
WimpSprite::WimpSprite | ( | int | file_type, |
std::string | leafname | ||
) |
Construct a wimp sprite to represent the given file_type.
Applications will be check for the name sprite first.
If the sprite is not in the current wimp sprite pool unknown will be used.
file_type | file type to construct sprite for |
leafname | leaf name of file (used for applications) |
|
inlinevirtual |
Return sprite area id used for calls that take an area pointer or a special value for WIMP/System areas.
This is always 1 for the wimp sprite area.
Implements tbx::Sprite.
|
virtual |
Get the scale factors required to plot this sprite in the WIMP as its logical size.
factor | scale factors updated with the correct value |
Implements tbx::Sprite.
|
virtual |
Get information about the sprite.
pixel_size | pointer to Size to be updated with size of sprite in pixels |
mode | pointer to integer to receive the sprite mode number or 0 (the default) not to return the mode |
mask | pointer to a boolean which will be set to true if the sprite has a mask or 0 (the default) not to return the mask |
Implements tbx::Sprite.
|
inlinevirtual |
|
virtual |
Plot this sprite scaled using the given colour translation.
Implements tbx::Sprite.
|
virtual |
Plot this sprite scaled using the given colour translation.
Implements tbx::Sprite.
|
virtual |
Plot sprite to screen.
Calculates the translation table and scale factors for the current screen and plots the sprite
Implements tbx::Sprite.
|
virtual |
Plot sprite to screen.
Calculates the translation table and scale factors for the current screen and plots the sprite
Implements tbx::Sprite.