Woopsi 1.0 GUI Framework for Nintendo DS Homebrew

- Main Page
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Protected Attributes

# WoopsiUI::Gradient Class Reference

`#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
| ) |  |

Constructor.

Parameters:

  x | The x co-ordinate of the gadget.
  y | The y co-ordinate of the gadget.
  width | The width of the gadget.
  height | The height of the gadget.
  fromColour | The start colour for the gradient (top colour).
  toColour | The end colour for the gradient (bottom colour).

virtual WoopsiUI::Gradient::~Gradient | ( |  | ) | `[inline, protected, virtual]`

Destructor.

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.

Parameters:

  port | The GraphicsPort to draw to.

See also:
  redraw()

Reimplemented from WoopsiUI::Gadget.

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

Resize the gadget and recalculate the gradient.

Parameters:

  width | The new gadget width.
  height | The 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

u16 WoopsiUI::Gradient::_fromColour`[protected]`

Initial gradient colour

s16 WoopsiUI::Gradient::_numberB`[protected]`

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

s16 WoopsiUI::Gradient::_numberG`[protected]`

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

s16 WoopsiUI::Gradient::_numberR`[protected]`

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

s16* WoopsiUI::Gradient::_rowColour`[protected]`

Array of precalculated gradient colours for each step

u16 WoopsiUI::Gradient::_toColour`[protected]`

Final gradient colour

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

- gradient.h