Woopsi 1.0
GUI Framework for Nintendo DS Homebrew
|
#include <superbitmap.h>
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 |
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.
WoopsiUI::SuperBitmap::SuperBitmap | ( | s16 | x, |
s16 | y, | ||
u16 | width, | ||
u16 | height, | ||
u16 | bitmapWidth, | ||
u16 | bitmapHeight, | ||
bool | isDecoration, | ||
GadgetStyle * | style = NULL |
||
) |
Constructor.
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.
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.
port | The GraphicsPort to draw to. |
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.
port | The GraphicsPort to draw to. |
Reimplemented from WoopsiUI::Gadget.
Bitmap* WoopsiUI::SuperBitmap::getBitmap | ( | ) |
Get a 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.
virtual void WoopsiUI::SuperBitmap::onClick | ( | s16 | x, |
s16 | y | ||
) | [protected, virtual] |
Starts the dragging system.
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.
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.
Bitmap* WoopsiUI::SuperBitmap::_bitmap [protected] |
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