TransparentSprite Class Reference
[Toolkit classes]

A Sprite with transparency capability. More...

#include <transparentsprite.h>

Inherits Graphic.

Inherited by LogicRobot.

Collaboration diagram for TransparentSprite:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 TransparentSprite ()
 Creates a null TransparentSprite.
 TransparentSprite (int type, int alpha)
 Creates a sprite and places it offscreen.
 TransparentSprite (int type, Point location, int alpha)
 TransparentSprite (int type, int x, int y, int alpha)
 ~TransparentSprite ()
void draw (BITMAP *canvas, Point offset)
 Draws this object's bitmap, with transparency set to alpha.
void setAlpha (int alpha)
int getAlpha ()

Protected Attributes

BITMAP * sprite
 The image this object will display.
int type
 A code, specified by an enum, that describes what kind of TransparentSprite this is.
int alpha
 The transparency of this object. Must be in [0,255].


Detailed Description

A Sprite with transparency capability.

This class is very similar to its shorter-named sibling. It simply adds an alpha variable, which ranges from 0 (transparent) to 255 (opaque). The latter is also known as OPAQUE.

There is no noticable difference between a Sprite and a TransparentSprite which has alpha = 255.


Constructor & Destructor Documentation

TransparentSprite::TransparentSprite (  ) 

Creates a null TransparentSprite.

TransparentSprite::TransparentSprite ( int  type,
int  alpha 
)

Creates a sprite and places it offscreen.

TransparentSprite::TransparentSprite ( int  type,
Point  location,
int  alpha 
)

TransparentSprite::TransparentSprite ( int  type,
int  x,
int  y,
int  alpha 
)

TransparentSprite::~TransparentSprite (  ) 


Member Function Documentation

void TransparentSprite::draw ( BITMAP *  canvas,
Point  offset 
) [virtual]

Draws this object's bitmap, with transparency set to alpha.

Implements Graphic.

int TransparentSprite::getAlpha (  ) 

void TransparentSprite::setAlpha ( int  alpha  ) 


Member Data Documentation

int TransparentSprite::alpha [protected]

The transparency of this object. Must be in [0,255].

BITMAP* TransparentSprite::sprite [protected]

The image this object will display.

int TransparentSprite::type [protected]

A code, specified by an enum, that describes what kind of TransparentSprite this is.


The documentation for this class was generated from the following files:

Generated on Mon Mar 16 14:33:16 2009 for LearningGaming by  doxygen 1.5.7.1