Woopsi 1.3
Nintendo DS Gui Framework
Public Member Functions | Protected Member Functions | Protected Attributes
WoopsiUI::Gradient Class Reference

#include <libwoopsi/include/gradient.h>

Inheritance diagram for WoopsiUI::Gradient:

List of all members.

Public Member Functions

 Gradient (s16 x, s16 y, u16 width, u16 height, u16 fromColour, u16 toColour)

Protected Member Functions

virtual void drawContents (GraphicsPort *port)
virtual void onResize (u16 width, u16 height)
virtual void calculate ()
virtual void cacheRowColours ()
virtual ~Gradient ()
 Gradient (const Gradient &gradient)

Protected Attributes

u16 _fromColour
u16 _toColour
s16 _numberR
s16 _numberG
s16 _numberB
s16 _deltaR
s16 _deltaG
s16 _deltaB
s16 * _rowColour

Detailed Description

Class providing a vertical gradient-filled background.

Constructor & Destructor Documentation

WoopsiUI::Gradient::Gradient ( s16  x,
s16  y,
u16  width,
u16  height,
u16  fromColour,
u16  toColour 


xThe x co-ordinate of the gadget.
yThe y co-ordinate of the gadget.
widthThe width of the gadget.
heightThe height of the gadget.
fromColourThe start colour for the gradient (top colour).
toColourThe end colour for the gradient (bottom colour).
virtual WoopsiUI::Gradient::~Gradient ( ) [inline, protected, virtual]


WoopsiUI::Gradient::Gradient ( const Gradient gradient) [inline, protected]

Copy constructor is protected to prevent usage.

Member Function Documentation

virtual void WoopsiUI::Gradient::cacheRowColours ( ) [protected, virtual]

Precalculate the gradient colours to save processing time when drawing.

virtual void WoopsiUI::Gradient::calculate ( ) [protected, virtual]

Precalculates the properties of the gradient to save processing time later.

virtual void WoopsiUI::Gradient::drawContents ( GraphicsPort port) [protected, virtual]

Draw the area of this gadget that falls within the clipping region. Called by the redraw() function to draw all visible regions.

portThe GraphicsPort to draw to.
See also:

Reimplemented from WoopsiUI::Gadget.

virtual void WoopsiUI::Gradient::onResize ( u16  width,
u16  height 
) [protected, virtual]

Resize the gadget and recalculate the gradient.

widthThe new gadget width.
heightThe new gadget height.

Reimplemented from WoopsiUI::Gadget.

Member Data Documentation

s16 WoopsiUI::Gradient::_deltaB [protected]

Value that blue component is incremented at each new gradient step

s16 WoopsiUI::Gradient::_deltaG [protected]

Value that green component is incremented at each new gradient step

s16 WoopsiUI::Gradient::_deltaR [protected]

Value that red component is incremented at each new gradient step

Initial gradient colour

Number of steps to get from start to finish colour in blue component

Number of steps to get from start to finish colour in green component

Number of steps to get from start to finish colour in red component

Array of precalculated gradient colours for each step

Final gradient colour

The documentation for this class was generated from the following file:
 All Classes Functions Variables Enumerations Enumerator