|
Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
|
Functions | |
| cutscene_t * | initCutscene (cutsceneCb cbFunc, cnfsFileIdx_t nextIconIdx, uint8_t soundBank) |
| Required to begin a cutscene. | |
| void | removeAllStyles (cutscene_t *cutscene) |
| Removes all styles. Unlikely to be used by anybody else since you add all your styles at the start of the game. | |
| void | addCutsceneStyle (cutscene_t *cutscene, paletteColor_t textColor, cnfsFileIdx_t spriteIdx, cnfsFileIdx_t textBoxIdx, char *title, uint8_t numSpriteVariations, bool stageLeft, bool drawSprite, bool drawTextbox) |
| Adds a cutscene style to an internally managed list. | |
| void | setMidiParams (cutscene_t *cutscene, uint8_t styleIdx, uint8_t instrument, int8_t octaveOvset, uint16_t noteLength, bool slowAttack) |
| Set the Midi Params object. | |
| void | setSongPitches (cutscene_t *cutscene, int16_t songPitches[8]) |
| Set the Song Pitches object. | |
| void | addCutsceneLine (cutscene_t *cutscene, uint8_t styleIdx, char *body, bool flipHorizontal, int8_t spriteVariation, cutsceneCb cbFunc) |
| Adds a dialogue line to the cutscene. | |
| void | updateCutscene (cutscene_t *cutscene, int16_t btnState) |
| The update function of the cutscene must be called regularly from your game loop. | |
| void | drawCutscene (cutscene_t *cutscene, font_t *font) |
| The draw function of the cutscene must be called regularly from your draw loop. Update should typically be called before draw. | |
| void | deinitCutscene (cutscene_t *cutscene) |
| Frees data. Required to call where your mode exits or when done with cutscene_t. Remember you may recycle one cutscene_t for many cutscenes and deinit during Mode Exit. | |
| cutscene_t * initCutscene | ( | cutsceneCb | cbFunc, |
| cnfsFileIdx_t | nextIconIdx, | ||
| uint8_t | soundBank ) |
Required to begin a cutscene.
| cbFunc | A callback which is called when this cutscene concludes. Use it to unpause your game loop. |
| nextIconIdx | The file index of the first of four frames of the nextIcon graphic. |
| soundBank | 0 for general midi, 1 for MAGFest, 2 for MegaManX |
| void removeAllStyles | ( | cutscene_t * | cutscene | ) |
Removes all styles. Unlikely to be used by anybody else since you add all your styles at the start of the game.
| cutscene | Pointer to the cutscene_t |
| void addCutsceneStyle | ( | cutscene_t * | cutscene, |
| paletteColor_t | textColor, | ||
| cnfsFileIdx_t | spriteIdx, | ||
| cnfsFileIdx_t | textBoxIdx, | ||
| char * | title, | ||
| uint8_t | numSpriteVariations, | ||
| bool | stageLeft, | ||
| bool | drawSprite, | ||
| bool | drawTextbox ) |
Adds a cutscene style to an internally managed list.
| cutscene | Pointer to the cutscene_t |
| textColor | The color to draw text |
| spriteIdx | The file index of the first pose of a character |
| textBoxIdx | The file index of the textbox sprite |
| title | The text drawn for a character's name |
| numSpriteVariations | The number of sprites/poses of this character |
| stageLeft | If false then this character will slide on and off the right side of the screen. True for left side. |
| drawSprite | If true, then the character pose is drawn. Use false to draw nothing. |
| drawTextbox | If true, then the textbox sprite is drawn behind the text. Use false to draw just the text with no textbox. |
| void setMidiParams | ( | cutscene_t * | cutscene, |
| uint8_t | styleIdx, | ||
| uint8_t | instrument, | ||
| int8_t | octaveOvset, | ||
| uint16_t | noteLength, | ||
| bool | slowAttack ) |
Set the Midi Params object.
| cutscene | Pointer to the cutscene_t |
| styleIdx | An index into the styles list |
| instrument | An instrument program # |
| octaveOvset | The number of octaves to transpose the sounds up or down. Zero for no transposition. |
| noteLength | Vaguely the note length, but not precisely. |
| slowAttack | Set to true to make this character sound really loose. Set to false to sound snappy. |
| void setSongPitches | ( | cutscene_t * | cutscene, |
| int16_t | songPitches[8] ) |
Set the Song Pitches object.
| cutscene | Pointer to the cutscene_t |
| songPitches | No less than four midi pitches and no more than 8 that may play well against other background music. Any -1's will be ignored in the array. |
| void addCutsceneLine | ( | cutscene_t * | cutscene, |
| uint8_t | styleIdx, | ||
| char * | body, | ||
| bool | flipHorizontal, | ||
| int8_t | spriteVariation, | ||
| cutsceneCb | cbFunc ) |
Adds a dialogue line to the cutscene.
| cutscene | Pointer to the cutscene |
| styleIdx | Index into the styles list |
| body | The dialogue text to draw |
| flipHorizontal | true to flip the character pose horizontally |
| spriteVariation | The specific pose sprite, counted up from the main pose sprite. |
| cbFunc | A callback function to fire when A is pressed on this line. Leave NULL to fire nothing. |
| void updateCutscene | ( | cutscene_t * | cutscene, |
| int16_t | btnState ) |
The update function of the cutscene must be called regularly from your game loop.
| cutscene | Pointer to the cutscene_t |
| btnState | Button state |
| void drawCutscene | ( | cutscene_t * | cutscene, |
| font_t * | font ) |
The draw function of the cutscene must be called regularly from your draw loop. Update should typically be called before draw.
| cutscene | Pointer to the cutscene_t |
| font | Font to draw the character name and dialogue text |
| void deinitCutscene | ( | cutscene_t * | cutscene | ) |
Frees data. Required to call where your mode exits or when done with cutscene_t. Remember you may recycle one cutscene_t for many cutscenes and deinit during Mode Exit.
| cutscene |