Added font sizing, needs full testing

This commit is contained in:
2021-08-03 10:19:31 -07:00
parent c451538def
commit 23f1cb3d7e
17 changed files with 202 additions and 15 deletions

View File

@ -42,6 +42,7 @@
#include "game/poker/pokergame.h"
#include "game/poker/pokerdiscussion.h"
#include "game/poker/pokergameassets.h"
#include "game/poker/pokerui.h"
// Player Input
#include "input/input.h"
@ -57,6 +58,9 @@
#include "poker/poker.h"
#include "poker/winner.h"
// User Interface Objects
#include "ui/label.h"
// Utility Objects
#include "util/array.h"
#include "util/list.h"

View File

@ -24,8 +24,11 @@
/** Refer to STBTT docs for OpenGL Fill Mode v d3d Fill Modes */
#define FONT_FILL_MODE 1
/** Passed to STBTT for scaling the font nicely, essentially the font size. */
#define FONT_TEXTURE_SIZE 32
/** Passed to STBTT for scaling the font, essentially the font resolution */
#define FONT_TEXTURE_SIZE 64
/** Default Font Size (on which all font scales are based) */
#define FONT_SIZE_DEFAULT (FONT_TEXTURE_SIZE / 2)
// Chars
#define FONT_NEWLINE '\n'

View File

@ -9,5 +9,5 @@
#include "../../libs.h"
typedef struct {
int32_t INeedSomePropertyToStopCompilerComplaining;
} dawngame_t;

View File

@ -0,0 +1,14 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "../../libs.h"
#include "../../ui/label.h"
typedef struct {
label_t labelTest;
} pokerui_t;

View File

@ -11,4 +11,4 @@
#define SETTING_GAME_DAWN 2
// Settings
#define SETTING_GAME SETTING_GAME_DAWN
#define SETTING_GAME SETTING_GAME_POKER

20
include/dawn/ui/label.h Normal file
View File

@ -0,0 +1,20 @@
/**
* 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/primitive.h"
#include "../display/gui/font.h"
/** Representation of a Label UI Element */
typedef struct {
font_t *font;
float x, y, z;
float fontSize;
fonttextinfo_t info;
primitive_t primitive;
} label_t;

View File

@ -13,6 +13,8 @@
/** Amount of characters scrolled, per second */
#define VN_TEXTBOX_SCROLL_SPEED 60
#define VN_TEXTBOX_FONT_SIZE 16.0
#define VN_TEXTBOX_STATE_CLOSED 0x01
typedef struct {