Stellarium 0.11.1
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure
Public Slots | Public Member Functions
ScreenImageMgr Class Reference

#include <ScreenImageMgr.hpp>

List of all members.

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)

Public Member Functions

 ScreenImageMgr ()
virtual void init ()
virtual void draw (StelCore *core)
virtual void update (double deltaTime)
virtual double getCallOrder (StelModuleActionName actionName) const

Detailed Description

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.

Member Function Documentation

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.

idthe ID to use when referring to this image (an arbitrary string).
filenamethe partial path of the file to load. This will be searched for using StelFileMgr, with "scripts/" prefixed to the filename.
xThe x-coordinate for the image (0 = left of screen)
yThe y-coordinate for the image (0 = bottom of screen)
visibleThe initial visible state of the image
alphaThe initial alpha (transparancy) value for the image (range 0.0 to 1.0)
fadeDurationthe time it takes for screen images to fade in/out/change alpha in seconds.
void ScreenImageMgr::deleteImage ( const QString &  id) [slot]

Delete an image.

idthe ID for the desired image.
virtual void ScreenImageMgr::draw ( StelCore core) [virtual]

Execute all the drawing functions for this module.

corethe core to use for the drawing

Reimplemented from StelModule.

int ScreenImageMgr::getImageWidth ( const QString &  id) [slot]

Set an image's visible status.

idthe ID for the desired image.
showthe new visible state to set.
bool ScreenImageMgr::getShowImage ( const QString &  id) [slot]

Find out if an image is currently visible.

idthe 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.

idthe ID for the desired image.
alphathe 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.

idthe ID for the desired image.
xThe new x-coordinate for the image.
yThe new y-coordinate for the image.
durationThe time for the change to take place, in seconds.