Stellarium 0.11.4 | |||
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure |
Module for managing images for scripting. More...
#include <ScreenImageMgr.hpp>
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.) |
Create an image from a file and display on the screen at x,y coordinates. | |
bool | getShowImage (const QString &id) |
Find out if an image is currently visible. | |
int | getImageWidth (const QString &id) |
Set an image's visible status. | |
int | getImageHeight (const QString &id) |
void | showImage (const QString &id, bool show) |
void | setImageAlpha (const QString &id, float alpha) |
Set an image's alpha value when visible. | |
void | setImageXY (const QString &id, float x, float y, float duration=0.) |
Set the x and y coordinates for the specified image. | |
void | deleteImage (const QString &id) |
Delete an image. | |
void | deleteAllImages (void) |
Delete all images currently managed by ScreenImageMgr. | |
QStringList | getAllImageIDs (void) |
Get a list of currently loaded image IDs. | |
Public Member Functions | |
ScreenImageMgr () | |
Construct a LabelMgr object. | |
virtual void | init () |
Initialize itself. | |
virtual void | draw (StelCore *core) |
Execute all the drawing functions for this module. | |
virtual void | update (double deltaTime) |
Update time-dependent parts of the module. | |
virtual double | getCallOrder (StelModuleActionName actionName) const |
Defines the order in which the various modules are drawn. |
Module for managing images for scripting.
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.
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. |
void ScreenImageMgr::deleteAllImages | ( | void | ) | [slot] |
Delete all images currently managed by ScreenImageMgr.
void ScreenImageMgr::deleteImage | ( | const QString & | id | ) | [slot] |
Delete an image.
id | the ID for the desired image. |
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.
QStringList ScreenImageMgr::getAllImageIDs | ( | void | ) | [slot] |
Get a list of currently loaded image IDs.
virtual double ScreenImageMgr::getCallOrder | ( | StelModuleActionName | actionName | ) | const [virtual] |
Defines the order in which the various modules are drawn.
Reimplemented from StelModule.
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. |
bool ScreenImageMgr::getShowImage | ( | const QString & | id | ) | [slot] |
Find out if an image is currently visible.
id | the ID for the desired image. |
virtual void ScreenImageMgr::init | ( | ) | [virtual] |
Initialize itself.
If the initialization takes significant time, the progress should be displayed on the loading bar.
Implements StelModule.
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. |
virtual void ScreenImageMgr::update | ( | double | deltaTime | ) | [virtual] |
Update time-dependent parts of the module.
Implements StelModule.