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::SuperBitmap Class Reference

`#include <superbitmap.h>`

Inheritance diagram for WoopsiUI::SuperBitmap:

List of all members.

## Public Member Functions
| SuperBitmap (s16 x, s16 y, u16 width, u16 height, u16 bitmapWidth, u16 bitmapHeight, bool isDecoration, GadgetStyle *style=NULL)
Bitmap * | getBitmap ()
Graphics * | getGraphics ()
virtual void | clearBitmap ()
## Protected Member Functions
virtual void | drawContents (GraphicsPort *port)
virtual void | drawBorder (GraphicsPort *port)
virtual void | onDrag (s16 x, s16 y, s16 vX, s16 vY)
virtual void | onClick (s16 x, s16 y)
virtual | ~SuperBitmap ()
| SuperBitmap (const SuperBitmap &superBitmap)
## Protected Attributes
s32 | _bitmapX
s32 | _bitmapY
Bitmap * | _bitmap
Graphics * | _graphics

## Detailed Description

The SuperBitmap class provides a set of 2D drawing tools and a bitmap in RAM to draw on. The class manifests itself as a gadget that can be scrolled around using the stylus.

## Constructor & Destructor Documentation

WoopsiUI::SuperBitmap::SuperBitmap | ( | s16 | x,
|  | s16 | y,
|  | u16 | width,
|  | u16 | height,
|  | u16 | bitmapWidth,
|  | u16 | bitmapHeight,
|  | bool | isDecoration,
|  | GadgetStyle * | style = `NULL`
| ) |  |

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.
  bitmapWidth | The desired width of the gadget's bitmap.
  bitmapHeight | The desired height of the gadget's bitmap.
  isDecoration | Specify if the gadget is a decoration or not. If set to true the gadget will function as a background image.
  style | The style that the gadget should use. If this is not specified, the gadget will use the values stored in the global defaultGadgetStyle object. The gadget will copy the properties of the style into its own internal style object.

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

Destructor.

WoopsiUI::SuperBitmap::SuperBitmap | ( | const SuperBitmap & | superBitmap | ) | `[inline, protected]`

Copy constructor is protected to prevent usage.

## Member Function Documentation

virtual void WoopsiUI::SuperBitmap::clearBitmap | ( |  | ) | `[virtual]`

Erases the internal bitmap by filling it with the gadget's back colour.

virtual void WoopsiUI::SuperBitmap::drawBorder | ( | 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::SuperBitmap::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.

Bitmap* WoopsiUI::SuperBitmap::getBitmap | ( |  | ) |

Get a pointer to the internal bitmap.

Returns:
  Pointer to the internal bitmap.

Graphics* WoopsiUI::SuperBitmap::getGraphics | ( |  | ) |

Get a pointer to a Graphics object that can be used to draw to the internal bitmap. Note that this should *not* be deleted.

Returns:
  Pointer to a graphics object for drawing to the internal bitmap.

virtual void WoopsiUI::SuperBitmap::onClick | ( | s16 | x,
|  | s16 | y
| ) |  | `[protected, virtual]`

Starts the dragging system.

Parameters:

  x | The x co-ordinate of the click.
  y | The y co-ordinate of the click.

Reimplemented from WoopsiUI::Gadget.

virtual void WoopsiUI::SuperBitmap::onDrag | ( | s16 | x,
|  | s16 | y,
|  | s16 | vX,
|  | s16 | vY
| ) |  | `[protected, virtual]`

Scrolls the bitmap.

Parameters:

  x | The x co-ordinate of the stylus.
  y | The y co-ordinate of the stylus.
  vX | The horizontal drag distance.
  vY | The vertical drag distance.

Reimplemented from WoopsiUI::Gadget.

## Member Data Documentation

Bitmap* WoopsiUI::SuperBitmap::_bitmap`[protected]`

Bitmap

s32 WoopsiUI::SuperBitmap::_bitmapX`[protected]`

X co-ordinate of the bitmap relative to the gadget

s32 WoopsiUI::SuperBitmap::_bitmapY`[protected]`

Y co-ordinate of the bitmap relative to the gadget

Graphics* WoopsiUI::SuperBitmap::_graphics`[protected]`

Graphics object for drawing to bitmap

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

- superbitmap.h