Stellarium 0.11.2
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure
Public Member Functions | Protected Attributes
ScreenImage Class Reference

List of all members.

Public Member Functions

 ScreenImage (const QString &filename, float x, float y, bool show=false, float scale=1., float alpha=1., float fadeDuration=1.)
virtual bool draw (const StelCore *core)
virtual void update (double deltaTime)
virtual void setFadeDuration (float duration)
virtual void setFlagShow (bool b)
virtual bool getFlagShow (void)
virtual void setAlpha (float a)
virtual void setXY (float x, float y, float duration=0.)
virtual void addXY (float x, float y, float duration=0.)
virtual int imageHeight (void)
virtual int imageWidth (void)

Protected Attributes

QGraphicsPixmapItem * tex
QTimeLine * moveTimer
QTimeLine * fadeTimer
QGraphicsItemAnimation * anim

Constructor & Destructor Documentation

ScreenImage::ScreenImage ( const QString &  filename,
float  x,
float  y,
bool  show = false,
float  scale = 1.,
float  alpha = 1.,
float  fadeDuration = 1. 
)

Load an image.

Parameters:
filenamethe partial path of the file to load. This will be searched for in the scripts directory using StelFileMgr.
xthe screen x-position for the texture (in pixels), measured from the left side of the screen.
ythe screen x-position for the texture (in pixels), measured from the bottom of the screen.
showthe initial displayed status of the image (false == hidden).
scalescale factor for the image. 1 = original size, 0.5 = 50% size etc.
fadeDurationthe time it takes for screen images to fade in/out/change alpha in seconds.

Member Function Documentation

virtual void ScreenImage::addXY ( float  x,
float  y,
float  duration = 0. 
) [virtual]

Set the x, y position of the image relative to the current position.

Parameters:
xthe offset in the x-axis
ythe offset in the y-axis
durationhow long for the movement to take in seconds
virtual bool ScreenImage::draw ( const StelCore core) [virtual]

Draw the image.

Parameters:
corethe StelCore object
virtual void ScreenImage::setAlpha ( float  a) [virtual]

Set the image alpha for when it is in full "on" (after fade in).

Parameters:
athe new alpha (transparency) for the image. 1.0 = totally transparent, 0.0 = fully opaque.
durationthe time for the change in alpha to take effect.
virtual void ScreenImage::setFlagShow ( bool  b) [virtual]

Show or hide the image (it will fade in/out)

Parameters:
bif true, the image will be shown, else it will be hidden
virtual void ScreenImage::setXY ( float  x,
float  y,
float  duration = 0. 
) [virtual]

Set the x, y position of the image.

Parameters:
xnew x position
ynew y position
durationhow long for the movement to take in seconds