![]() |
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure |
#include <ScreenImageMgr.hpp>
Inherits StelModule.
Public Slots | |
void | createScreenImage (const QString &id, const QString &filename, float x, float y, float scale=1., bool visible=true, float alpha=1., float fadeDuration=1.) |
bool | getShowImage (const QString &id) |
int | getImageWidth (const QString &id) |
int | getImageHeight (const QString &id) |
void | showImage (const QString &id, bool show) |
void | setImageAlpha (const QString &id, float alpha) |
void | setImageXY (const QString &id, float x, float y, float duration=0.) |
void | deleteImage (const QString &id) |
void | deleteAllImages (void) |
QStringList | getAllImageIDs (void) |
Signals | |
void | requestCreateScreenImage (const QString &id, const QString &filename, float x, float y, float scale, bool visible, float alpha, float fadeDuration) |
void | requestSetImageShow (const QString &id, bool b) |
void | requestSetImageAlpha (const QString &id, float alpha) |
void | requestSetImageXY (const QString &id, float x, float y, float duration) |
void | requestDeleteImage (const QString &id) |
void | requestDeleteAllImages (void) |
Public Member Functions | |
ScreenImageMgr () | |
virtual void | init () |
virtual void | draw (StelCore *core) |
virtual void | update (double deltaTime) |
virtual double | getCallOrder (StelModuleActionName actionName) const |
Images are identified by a string ID which is passed to ScreenImageMgr members when it is necessary to specify an image to work with. Member functions in this class which modify the state of the class are all mediated through the signal/slot mechanism to ensure such operations happen in the main thread where images are drawn, and not in the script thread.
ScreenImageMgr::ScreenImageMgr | ( | ) |
Construct a LabelMgr object.
virtual void ScreenImageMgr::init | ( | ) | [virtual] |
Initialize itself.
If the initialization takes significant time, the progress should be displayed on the loading bar.
Implements StelModule.
virtual void ScreenImageMgr::draw | ( | StelCore * | core | ) | [virtual] |
Execute all the drawing functions for this module.
core | the core to use for the drawing |
Reimplemented from StelModule.
virtual void ScreenImageMgr::update | ( | double | deltaTime | ) | [virtual] |
virtual double ScreenImageMgr::getCallOrder | ( | StelModuleActionName | actionName | ) | const [virtual] |
void ScreenImageMgr::createScreenImage | ( | const QString & | id, | |
const QString & | filename, | |||
float | x, | |||
float | y, | |||
float | scale = 1. , |
|||
bool | visible = true , |
|||
float | alpha = 1. , |
|||
float | fadeDuration = 1. | |||
) | [slot] |
Create an image from a file and display on the screen at x,y coordinates.
id | the ID to use when referring to this image (an arbitrary string). | |
filename | the partial path of the file to load. This will be searched for using StelFileMgr, with "scripts/" prefixed to the filename. | |
x | The x-coordinate for the image (0 = left of screen) | |
y | The y-coordinate for the image (0 = bottom of screen) | |
visible | The initial visible state of the image | |
alpha | The initial alpha (transparancy) value for the image (range 0.0 to 1.0) | |
fadeDuration | the time it takes for screen images to fade in/out/change alpha in seconds. |
bool ScreenImageMgr::getShowImage | ( | const QString & | id | ) | [slot] |
Find out if an image is currently visible.
id | the ID for the desired image. |
int ScreenImageMgr::getImageWidth | ( | const QString & | id | ) | [slot] |
Set an image's visible status.
id | the ID for the desired image. | |
show | the new visible state to set. |
void ScreenImageMgr::setImageAlpha | ( | const QString & | id, | |
float | alpha | |||
) | [slot] |
Set an image's alpha value when visible.
id | the ID for the desired image. | |
alpha | the new alpha value to set. |
void ScreenImageMgr::setImageXY | ( | const QString & | id, | |
float | x, | |||
float | y, | |||
float | duration = 0. | |||
) | [slot] |
Set the x and y coordinates for the specified image.
id | the ID for the desired image. | |
x | The new x-coordinate for the image. | |
y | The new y-coordinate for the image. | |
duration | The time for the change to take place, in seconds. |
void ScreenImageMgr::deleteImage | ( | const QString & | id | ) | [slot] |
Delete an image.
id | the ID for the desired image. |
void ScreenImageMgr::deleteAllImages | ( | void | ) | [slot] |
Delete all images currently managed by ScreenImageMgr.
QStringList ScreenImageMgr::getAllImageIDs | ( | void | ) | [slot] |
Get a list of currently loaded image IDs.