Still working on my scrolling text and bug fixing.

This commit is contained in:
2021-07-16 22:26:04 -07:00
parent 06202f6f7e
commit f619b7c9d2
26 changed files with 495 additions and 115 deletions

View File

@ -0,0 +1,22 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "../libs.h"
#define CONVERSATION_TEXT_COUNT_MAX 32
typedef struct {
char *text;
uint8_t speaker;
} conversationtext_t;
typedef struct {
conversationtext_t texts[CONVERSATION_TEXT_COUNT_MAX];
uint8_t textCount;
uint8_t textCurrent;
} conversation_t;

View File

@ -0,0 +1,46 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "../../libs.h"
#include "../../display/animation/timeline.h"
#include "../../display/gui/font.h"
/** Amount of characters scrolled, per second */
#define VN_TEXTBOX_SCROLL_SPEED 60
typedef struct {
/** Stores the maximum width that this textbox can take up */
float widthMax;
/** Font that the text box uses */
font_t *font;
/** How many rows of text at most can be displayed in a single text box */
int32_t linesMax;
int32_t lineCurrent;
/** X, Y Position of the textbox */
float x, y;
/** Animation of the textbox */
timeline_t animTimeline;
// timelineaction_t animActions;
/** Information about the current rendered text */
fonttextinfo_t textInfo;
/** Primitive to hold talking text */
primitive_t primitive;
// Testing assets
primitive_t testPrimitive;
texture_t testTexture;
/** Current spoken text, tracked in-case of re-render */
char *text;
} vntextbox_t;