Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
|
Functions | |
void | rotatePixel (int16_t *x, int16_t *y, int16_t rotateDeg, int16_t width, int16_t height) |
void | drawWsg (const wsg_t *wsg, int16_t xOff, int16_t yOff, bool flipLR, bool flipUD, int16_t rotateDeg) |
Draw a WSG to the display. | |
void | drawWsgSimple (const wsg_t *wsg, int16_t xOff, int16_t yOff) |
Draw a WSG to the display without flipping or rotation. | |
void | drawWsgSimpleScaled (const wsg_t *wsg, int16_t xOff, int16_t yOff, int16_t xScale, int16_t yScale) |
Draw a WSG to the display without flipping or rotation. | |
void | drawWsgSimpleHalf (const wsg_t *wsg, int16_t xOff, int16_t yOff) |
Draw a WSG to the display without flipping or rotation at half size. | |
void | drawWsgTile (const wsg_t *wsg, int32_t xOff, int32_t yOff) |
Quickly copy a WSG to the display without flipping or rotation or transparency. | |
void rotatePixel | ( | int16_t * | x, |
int16_t * | y, | ||
int16_t | rotateDeg, | ||
int16_t | width, | ||
int16_t | height ) |
Transform a pixel's coordinates by rotation around the sprite's center point, then reflection over Y axis, then reflection over X axis, then translation
x | The x coordinate of the pixel location to transform |
y | The y coordinate of the pixel location to transform |
rotateDeg | The number of degrees to rotate clockwise, must be 0-359 |
width | The width of the image |
height | The height of the image |
void drawWsg | ( | const wsg_t * | wsg, |
int16_t | xOff, | ||
int16_t | yOff, | ||
bool | flipLR, | ||
bool | flipUD, | ||
int16_t | rotateDeg ) |
Draw a WSG to the display.
wsg | The WSG to draw to the display |
xOff | The x offset to draw the WSG at |
yOff | The y offset to draw the WSG at |
flipLR | true to flip the image across the Y axis |
flipUD | true to flip the image across the X axis |
rotateDeg | The number of degrees to rotate clockwise, must be 0-359 |
void drawWsgSimple | ( | const wsg_t * | wsg, |
int16_t | xOff, | ||
int16_t | yOff ) |
Draw a WSG to the display without flipping or rotation.
wsg | The WSG to draw to the display |
xOff | The x offset to draw the WSG at |
yOff | The y offset to draw the WSG at |
void drawWsgSimpleScaled | ( | const wsg_t * | wsg, |
int16_t | xOff, | ||
int16_t | yOff, | ||
int16_t | xScale, | ||
int16_t | yScale ) |
Draw a WSG to the display without flipping or rotation.
wsg | The WSG to draw to the display |
xOff | The x offset to draw the WSG at |
yOff | The y offset to draw the WSG at |
xScale | The amount to scale the image horizontally |
yScale | The amount to scale the image vertically |
void drawWsgSimpleHalf | ( | const wsg_t * | wsg, |
int16_t | xOff, | ||
int16_t | yOff ) |
Draw a WSG to the display without flipping or rotation at half size.
wsg | The WSG to draw to the display |
xOff | The x offset to draw the WSG at |
yOff | The y offset to draw the WSG at |
void drawWsgTile | ( | const wsg_t * | wsg, |
int32_t | xOff, | ||
int32_t | yOff ) |
Quickly copy a WSG to the display without flipping or rotation or transparency.
If the source WSG does have transparency, an indeterminate color will be drawn to the TFT
wsg | The WSG to draw to the display |
xOff | The x offset to draw the WSG at |
yOff | The y offset to draw the WSG at |