|
Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
|
This file contains utilities for Cosplay Crunch microgames, mostly centered around tinting wsg images.
Go to the source code of this file.
Data Structures | |
| struct | tintColor_t |
| A set of colors used to tint a greyscale image. More... | |
Macros | |
| #define | PALETTE_LOWLIGHT c111 |
| Palette lowlight color to be tinted in grayscale images. See tintPalette() | |
| #define | PALETTE_BASE c222 |
| Palette base color to be tinted in grayscale images. See tintPalette() | |
| #define | PALETTE_BASE_ALT c333 |
| Palette alt base color to be tinted in grayscale images that need an extra color. See tintPalette() | |
| #define | PALETTE_HIGHLIGHT c444 |
| Palette highlight color to be tinted in grayscale images. See tintPalette() | |
Functions | |
| void | tintPalette (wsgPalette_t *palette, const tintColor_t *tintColor) |
Modifies a palette to be used for tinting greyscale images. The resulting palette is intended to be used with the wsgPalette* functions. | |
| void | drawToCanvas (wsg_t canvas, wsg_t wsg, uint16_t x, uint16_t y) |
| Draws a wsg image onto another wsg image. | |
| void | drawToCanvasTint (wsg_t canvas, wsg_t wsg, int32_t x, int32_t y, int32_t rotationDeg, const tintColor_t *tintColor) |
| Draws a wsg image drawn in greyscale onto another wsg image, tinting the grayscale pixels. This function can be used to tint a greyscale image in place. | |
| void | drawToCanvasTile (wsg_t canvas, wsg_t wsg, uint16_t x, uint16_t y) |
| Draws a wsg image onto another wsg image without taking transparent pixels into account. | |
| void | drawMessageBox (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, wsg_t fold) |
| Draws a box styled like a piece of paper for displaying text. | |
| struct tintColor_t |
| Data Fields | ||
|---|---|---|
| paletteColor_t | lowlight | |
| paletteColor_t | base | |
| paletteColor_t | highlight | |
| paletteColor_t | baseAlt | |
| #define PALETTE_LOWLIGHT c111 |
Palette lowlight color to be tinted in grayscale images. See tintPalette()
| #define PALETTE_BASE c222 |
Palette base color to be tinted in grayscale images. See tintPalette()
| #define PALETTE_BASE_ALT c333 |
Palette alt base color to be tinted in grayscale images that need an extra color. See tintPalette()
| #define PALETTE_HIGHLIGHT c444 |
Palette highlight color to be tinted in grayscale images. See tintPalette()
| void tintPalette | ( | wsgPalette_t * | palette, |
| const tintColor_t * | tintColor ) |
Modifies a palette to be used for tinting greyscale images. The resulting palette is intended to be used with the wsgPalette* functions.
| palette | The palette to be modified |
| tintColor | The color set to apply to the grey tones of the palette |
Draws a wsg image onto another wsg image.
| canvas | A wsg to draw onto |
| wsg | The image to draw to the canvas |
| x | x position to draw the wsg |
| y | y position to draw the wsg |
| void drawToCanvasTint | ( | wsg_t | canvas, |
| wsg_t | wsg, | ||
| int32_t | x, | ||
| int32_t | y, | ||
| int32_t | rotationDeg, | ||
| const tintColor_t * | tintColor ) |
Draws a wsg image drawn in greyscale onto another wsg image, tinting the grayscale pixels. This function can be used to tint a greyscale image in place.
| canvas | A wsg to draw onto |
| wsg | The image to draw to the canvas |
| x | x position to draw the wsg |
| y | y position to draw the wsg |
| rotationDeg | |
| tintColor | The color used to tint a greyscale wsg |
Draws a wsg image onto another wsg image without taking transparent pixels into account.
| canvas | A wsg to draw onto |
| wsg | The image to draw to the canvas |
| x | x position to draw the wsg |
| y | y position to draw the wsg |
| void drawMessageBox | ( | uint16_t | x1, |
| uint16_t | y1, | ||
| uint16_t | x2, | ||
| uint16_t | y2, | ||
| wsg_t | fold ) |
Draws a box styled like a piece of paper for displaying text.
| x1 | Left position of box |
| y1 | Top position of box |
| x2 | Right position of box |
| y2 | Bottom position of box |
| fold | Pointer to a top-right corner image. You probably want CC_MENU_FOLD_WSG |