Implement Wiggle Title Text

This commit is contained in:
2024-01-03 15:18:44 -06:00
parent d692d57bcf
commit aeb1cd57da
8 changed files with 66 additions and 14 deletions

View File

@@ -1,5 +1,8 @@
#include "../include/asset_mgr.hpp"
#include "include/font_writer.hpp"
#include "include/paco.hpp"
#include <FontWriter/fonts.hpp>
#include <FontWriter/font_writer.hpp>
#include <stdio.h>
using namespace JabyEngine;
@@ -10,14 +13,22 @@ static object::Paco paco;
static void setup() {
Assets::Main::load();
FontWriter::setup();
paco.setup();
}
static void update() {
static const char Title[] = "Pool Box";
static constexpr auto TitleLength = (sizeof(Title) - 1)*DefaultFont::Info.font_size.width;
auto cursor = FontWriter::update(JabyEngine::Make::PositionI16((GPU::Display::Width-TitleLength)/2, 16));
paco.update();
FontWriter::new_font_writer.write(cursor, Title, GPU::Color24::Yellow(), &FontWriter::wiggle);
}
static void render() {
FontWriter::new_font_writer.render();
paco.render();
}