A VRAM accessor for drawing graphics in the BG0 mode. More...
#include <sifteo/video/bg0.h>
Public Member Functions | |
CubeID | cube () const |
Return the CubeID associated with this drawable. | |
void | erase (uint16_t index=0) |
Erase mode-specific VRAM, filling the BG0 buffer with the specified absolute tile index value and resetting the panning registers. | |
void | erase (const PinnedAssetImage &image) |
Erase mode-specific VRAM, filling the BG0 buffer with the first tile from the specified PinnedAssetImage and resetting the panning registers. | |
void | fill (UInt2 topLeft, UInt2 size, unsigned tileIndex) |
Fill a rectangle of identical tiles, specified as a top-left corner location and a size. More... | |
void | fill (UInt2 topLeft, UInt2 size, const PinnedAssetImage &image) |
Fill a rectangle of identical tiles, using the first tile of a pinned asset. More... | |
Int2 | getPanning () const |
Retrieve the last value set by setPanning(), modulo the layer size in pixels. | |
void | image (UInt2 pos, const AssetImage &image, unsigned frame=0) |
Draw a full AssetImage frame, with its top-left corner at the specified location. More... | |
void | image (UInt2 destXY, UInt2 size, const AssetImage &image, UInt2 srcXY, unsigned frame=0) |
Draw part of an AssetImage frame, with its top-left corner at the specified location. More... | |
void | plot (UInt2 pos, uint16_t tileIndex) |
Plot a single tile, by absolute tile index, at location 'pos' in tile units. More... | |
void | setPanning (Int2 pixels) |
Change the hardware pixel-panning origin for this mode. More... | |
void | span (UInt2 pos, unsigned width, unsigned tileIndex) |
Plot a horizontal span of tiles, by absolute tile index, given the position of the leftmost tile and the number of tiles to plot. More... | |
void | span (UInt2 pos, unsigned width, const PinnedAssetImage &image) |
Plot a horizontal span of tiles, using the first tile of a pinned asset. More... | |
void | text (Int2 topLeft, const AssetImage &font, const char *str, char firstChar= ' ') |
Draw text, using an AssetImage as a fixed width font. More... | |
uint16_t | tile (UInt2 pos) |
Retrieve the absolute tile index currently set at the given address. The inverse of plot(). | |
uint16_t | tileAddr (UInt2 pos) |
Calculate the video buffer address of a particular tile. More... | |
_SYSVideoBuffer & | videoBuffer () |
Return the VideoBuffer associated with this drawable. | |
Static Public Member Functions | |
static unsigned | pixelHeight () |
Return the height, in pixel, of this mode. | |
static UInt2 | pixelSize () |
Return the size of this mode as a vector, in pixels. | |
static unsigned | pixelWidth () |
Return the width, in pixels, of this mode. | |
static unsigned | sizeInBytes () |
Returns the size of this drawable's tile data, in bytes. | |
static unsigned | sizeInWords () |
Returns the size of this drawable's tile data, in 16-bit words. | |
static unsigned | tileHeight () |
Return the height, in tiles, of this mode. | |
static UInt2 | tileSize () |
Return the size of this mode as a vector, in tiles. | |
static unsigned | tileWidth () |
Return the width, in tiles, of this mode. | |
A VRAM accessor for drawing graphics in the BG0 mode.
We have an 18x18 tile grid, which wraps around in both axes.
Fill a rectangle of identical tiles, specified as a top-left corner location and a size.
All coordinates must be in range. This function performs no clipping.
|
inline |
Fill a rectangle of identical tiles, using the first tile of a pinned asset.
All coordinates must be in range. This function performs no clipping.
|
inline |
Draw a full AssetImage frame, with its top-left corner at the specified location.
Locations are specified in tile units, relative to the top-left of the 18x18 grid.
All coordinates must be in range. This function performs no clipping.
|
inline |
Draw part of an AssetImage frame, with its top-left corner at the specified location.
Locations are specified in tile units, relative to the top-left of the 18x18 grid.
All coordinates must be in range. This function performs no clipping.
|
inline |
Plot a single tile, by absolute tile index, at location 'pos' in tile units.
All coordinates must be in range. This function performs no clipping.
|
inline |
Change the hardware pixel-panning origin for this mode.
The supplied vector is interpreted as the location on the tile buffer, in pixels, where the origin of the LCD will begin.
BG0 is an 18x18 buffer that wraps around in both directions.
|
inline |
Plot a horizontal span of tiles, by absolute tile index, given the position of the leftmost tile and the number of tiles to plot.
All coordinates must be in range. This function performs no clipping.
|
inline |
Plot a horizontal span of tiles, using the first tile of a pinned asset.
All coordinates must be in range. This function performs no clipping.
|
inline |
Draw text, using an AssetImage as a fixed width font.
Each character is represented by a consecutive 'frame' in the image. Characters not present in the font will be skipped.
|
inline |
Calculate the video buffer address of a particular tile.
All coordinates must be in range. This function performs no clipping.
Sifteo SDK v1.1.0 (see all versions)
Last updated Tue Dec 23 2014, by Doxygen