39 lines
694 B
C
39 lines
694 B
C
/**
|
|
* Copyright (c) 2025 Dominic Masters
|
|
*
|
|
* This software is released under the MIT License.
|
|
* https://opensource.org/licenses/MIT
|
|
*/
|
|
|
|
#include "rpgtextbox.h"
|
|
#include "util/memory.h"
|
|
#include "util/string.h"
|
|
#include "assert/assert.h"
|
|
|
|
rpgtextbox_t RPG_TEXTBOX;
|
|
|
|
void rpgTextboxInit() {
|
|
memoryZero(&RPG_TEXTBOX, sizeof(rpgtextbox_t));
|
|
}
|
|
|
|
void rpgTextboxShow(
|
|
const rpgtextboxpos_t position,
|
|
const char_t *text
|
|
) {
|
|
RPG_TEXTBOX.position = position;
|
|
RPG_TEXTBOX.visible = true;
|
|
|
|
stringCopy(
|
|
RPG_TEXTBOX.text,
|
|
text,
|
|
RPG_TEXTBOX_MAX_CHARS
|
|
);
|
|
}
|
|
|
|
void rpgTextboxHide() {
|
|
RPG_TEXTBOX.visible = false;
|
|
}
|
|
|
|
bool_t rpgTextboxIsVisible() {
|
|
return RPG_TEXTBOX.visible;
|
|
} |