FIFE
|
Object visual contains data that is needed for visualizing objects. More...
#include <visual.h>
Public Member Functions | |
virtual | ~ObjectVisual () |
Destructor. More... | |
void | addStaticImage (uint32_t angle, int32_t image_index) |
Adds new static image with given angle (degrees) Static images are used in case there are no actions active in the instance There can be several static images for different angles, that are used in case view / layer is rotated In case there are no exact matches for current view angles, closest one is used. More... | |
int32_t | getStaticImageIndexByAngle (int32_t angle) |
Returns closest matching static image for given angle. More... | |
int32_t | getClosestMatchingAngle (int32_t angle) |
Returns closest matching image angle for given angle. More... | |
void | getStaticImageAngles (std::vector< int32_t > &angles) |
Returns list of available static image angles for this object. More... | |
![]() | |
virtual | ~Visual2DGfx () |
Destructor. More... | |
![]() | |
virtual | ~IVisual () |
Static Public Member Functions | |
static ObjectVisual * | create (Object *object) |
Constructs and assigns it to the passed item. More... | |
Private Member Functions | |
ObjectVisual () | |
Constructor. More... | |
Private Attributes | |
type_angle2id | m_angle2img |
Additional Inherited Members | |
![]() | |
Visual2DGfx () | |
Constructor. More... | |
Object visual contains data that is needed for visualizing objects.
|
virtual |
Destructor.
Definition at line 64 of file visual.cpp.
|
private |
Constructor.
Definition at line 52 of file visual.cpp.
Referenced by create().
void FIFE::ObjectVisual::addStaticImage | ( | uint32_t | angle, |
int32_t | image_index | ||
) |
Adds new static image with given angle (degrees) Static images are used in case there are no actions active in the instance There can be several static images for different angles, that are used in case view / layer is rotated In case there are no exact matches for current view angles, closest one is used.
angle | angle for image. 0 degrees starts from right and turns counter-clockwise (normal math notation) |
image_index | index of image to use for given degress |
Definition at line 67 of file visual.cpp.
References m_angle2img.
Referenced by FIFE::ObjectLoader::load(), and FIFE::AtlasLoader::parseObject().
|
static |
Constructs and assigns it to the passed item.
Definition at line 55 of file visual.cpp.
References FIFE::Object::getVisual(), and ObjectVisual().
Referenced by FIFE::ObjectLoader::load(), and FIFE::AtlasLoader::parseObject().
int32_t FIFE::ObjectVisual::getClosestMatchingAngle | ( | int32_t | angle | ) |
Returns closest matching image angle for given angle.
Definition at line 76 of file visual.cpp.
References FIFE::getIndexByAngle(), and m_angle2img.
void FIFE::ObjectVisual::getStaticImageAngles | ( | std::vector< int32_t > & | angles | ) |
Returns list of available static image angles for this object.
Definition at line 82 of file visual.cpp.
References m_angle2img.
Referenced by FIFE::MapLoader::load().
int32_t FIFE::ObjectVisual::getStaticImageIndexByAngle | ( | int32_t | angle | ) |
Returns closest matching static image for given angle.
Definition at line 71 of file visual.cpp.
References FIFE::getIndexByAngle(), and m_angle2img.
|
private |
Definition at line 105 of file visual.h.
Referenced by addStaticImage(), getClosestMatchingAngle(), getStaticImageAngles(), and getStaticImageIndexByAngle().