47 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			47 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
/**
 | 
						|
 * 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 */
 | 
						|
  float textScroll;
 | 
						|
  // 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; |