Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
Loading...
Searching...
No Matches
textEntry.c File Reference

Functions

void textEntryInit (font_t *useFont, int max_len, char *buffer)
 Initialize the text entry with prettier graphics.
 
bool textEntryDraw (int64_t elapsedUs)
 Draw the text entry UI.
 
bool textEntryInput (uint8_t down, uint8_t button)
 Handle button input for text entry.
 
void textEntrySetFont (font_t *newFont)
 A new font to load into the text entry screen.
 
void textEntrySetBgWsg (wsg_t *BG)
 Sets a background image and sets the BG Mode to use the WSG.
 
void textEntrySetBGColor (uint8_t color)
 Sets the background to use a solid color.
 
void textEntrySetBGTransparent ()
 Sets the background to be transparent.
 
void textEntrySetTextColor (uint8_t color, bool emphasis)
 Set the main text color for the keyboard and entry text.
 
void textEntrySetEmphasisColor (uint8_t color)
 Set the emphasis color for the text.
 
void textEntrySetShadowboxColor (bool active, uint8_t color)
 Sets the color of the shadowbox.
 
void textEntrySetNewEnterStyle (bool newStyle)
 Sets the style of the Enter key.
 
void textEntrySetNewCapsStyle (bool newStyle)
 Sets the style of the caps lock key.
 
void textEntrySetMultiline (bool multiline)
 Sets the text entry mode from single line to multi-line.
 
void textEntrySoftReset ()
 Allow the text box to continue without a full reset.
 
void textEntrySetPrompt (char *prompt)
 Sets the prompt text to be displayed. Use an empty string ("") to disable.
 
void textEntrySetCapMode ()
 Sets the starting mode to capslock.
 
void textEntrySetNoShiftMode ()
 Sets the starting mode to lowercase text.
 
void textEntrySetShiftMode ()
 Sets the starting mode to Shift, does one capital letter.
 
void textEntrySetNounMode ()
 Sets the starting mode to Porper Nouns (Auto capitalizes first letter after a space)
 

Variables

bgMode_t backgroundMode
 

Function Documentation

◆ textEntryInit()

void textEntryInit ( font_t * useFont,
int max_len,
char * buffer )

Initialize the text entry with prettier graphics.

Parameters
useFontThe font to use
max_lenThe length of buffer
bufferA char* to store the entered text in

◆ textEntryDraw()

bool textEntryDraw ( int64_t elapsedUs)

Draw the text entry UI.

Returns
true if text entry is still being used false if text entry is finished

◆ textEntryInput()

bool textEntryInput ( uint8_t down,
uint8_t button )

Handle button input for text entry.

Parameters
downtrue if the button was pressed, false if it was released
buttonThe button that was pressed
Returns
true if text entry is still ongoing false if the enter key was pressed and text entry is done

◆ textEntrySetFont()

void textEntrySetFont ( font_t * newFont)

A new font to load into the text entry screen.

Parameters
newFontpointer to a font file

◆ textEntrySetBgWsg()

void textEntrySetBgWsg ( wsg_t * BG)

Sets a background image and sets the BG Mode to use the WSG.

Parameters
BGPointer to Background image to set

◆ textEntrySetBGColor()

void textEntrySetBGColor ( uint8_t color)

Sets the background to use a solid color.

Parameters
colorColor to set the background

◆ textEntrySetBGTransparent()

void textEntrySetBGTransparent ( void )

Sets the background to be transparent.

◆ textEntrySetTextColor()

void textEntrySetTextColor ( uint8_t color,
bool emphasis )

Set the main text color for the keyboard and entry text.

Parameters
colorColor to set the text to.
emphasisWhether emphasis color should also be set to the same color

◆ textEntrySetEmphasisColor()

void textEntrySetEmphasisColor ( uint8_t color)

Set the emphasis color for the text.

Parameters
colorColor for the emphasis text

◆ textEntrySetShadowboxColor()

void textEntrySetShadowboxColor ( bool active,
uint8_t color )

Sets the color of the shadowbox.

Parameters
activeWhether these boxes should be drawn
colorColor for the shadowboxes

◆ textEntrySetNewEnterStyle()

void textEntrySetNewEnterStyle ( bool newStyle)

Sets the style of the Enter key.

Parameters
newStyleif true, use the new style

◆ textEntrySetNewCapsStyle()

void textEntrySetNewCapsStyle ( bool newStyle)

Sets the style of the caps lock key.

Parameters
newStyleif true, use the new style

◆ textEntrySetMultiline()

void textEntrySetMultiline ( bool multiline)

Sets the text entry mode from single line to multi-line.

Parameters
multilineTrue if using multi-line, false if not
Note
cursor does not draw in multiline due to drawTextWordWrap not exposing the end position of the text.

◆ textEntrySoftReset()

void textEntrySoftReset ( void )

Allow the text box to continue without a full reset.

◆ textEntrySetPrompt()

void textEntrySetPrompt ( char * prompt)

Sets the prompt text to be displayed. Use an empty string ("") to disable.

Parameters
promptText string to use

◆ textEntrySetCapMode()

void textEntrySetCapMode ( void )

Sets the starting mode to capslock.

◆ textEntrySetNoShiftMode()

void textEntrySetNoShiftMode ( void )

Sets the starting mode to lowercase text.

◆ textEntrySetShiftMode()

void textEntrySetShiftMode ( void )

Sets the starting mode to Shift, does one capital letter.

◆ textEntrySetNounMode()

void textEntrySetNounMode ( void )

Sets the starting mode to Porper Nouns (Auto capitalizes first letter after a space)

Variable Documentation

◆ backgroundMode

bgMode_t backgroundMode