mirror of
https://github.com/ctruLua/ctruLua.git
synced 2025-10-28 00:39:30 +00:00
Updated sftdlib and sf2dlib
This commit is contained in:
parent
3fd2efb77e
commit
49ae4454d3
11 changed files with 373 additions and 170 deletions
BIN
libs/sftdlib/sample/data/FreeSans.ttf
Normal file
BIN
libs/sftdlib/sample/data/FreeSans.ttf
Normal file
Binary file not shown.
Binary file not shown.
|
|
@ -4,19 +4,17 @@
|
|||
#include <3ds.h>
|
||||
#include <sf2d.h>
|
||||
#include <sftd.h>
|
||||
#include "airstrike_ttf.h"
|
||||
#include "FreeSans_ttf.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
sf2d_init();
|
||||
sf2d_set_clear_color(RGBA8(0x40, 0x40, 0x40, 0xFF));
|
||||
|
||||
consoleInit(GFX_BOTTOM, NULL);
|
||||
printf("sftd sample\n");
|
||||
sf2d_set_vblank_wait(0);
|
||||
|
||||
// Font loading
|
||||
sftd_init();
|
||||
sftd_font *font = sftd_load_font_mem(airstrike_ttf, airstrike_ttf_size);
|
||||
sftd_font *font = sftd_load_font_mem(FreeSans_ttf, FreeSans_ttf_size);
|
||||
|
||||
while (aptMainLoop()) {
|
||||
|
||||
|
|
@ -25,8 +23,32 @@ int main()
|
|||
|
||||
sf2d_start_frame(GFX_TOP, GFX_LEFT);
|
||||
|
||||
sftd_draw_text(font, 10, 10, RGBA8(255, 0, 0, 255), 20, "Font drawing on the top screen!");
|
||||
sftd_draw_textf(font, 10, 40, RGBA8(0, 255, 0, 255), 20, "FPS %f", sf2d_get_fps());
|
||||
sftd_draw_textf(font, 10, 10, RGBA8(0, 255, 0, 255), 20, "FPS %f", sf2d_get_fps());
|
||||
|
||||
sftd_draw_text(font, 10, 30, RGBA8(255, 0, 0, 255), 20, "Font drawing on the top screen!");
|
||||
sftd_draw_text(font, 10, 50, RGBA8(0, 255, 0, 255), 15, "Font drawing on the top screen!");
|
||||
sftd_draw_text(font, 10, 68, RGBA8(0, 0, 255, 255), 25, "Font drawing on the top screen!");
|
||||
sftd_draw_text(font, 10, 90, RGBA8(255, 255, 0, 255), 10, "Font drawing on the top screen!");
|
||||
sftd_draw_text(font, 10, 105, RGBA8(255, 0, 255, 255), 8, "Font drawing on the top screen!");
|
||||
sftd_draw_text(font, 10, 120, RGBA8(0, 255, 255, 255), 30, "Font drawing on the top screen!");
|
||||
|
||||
sftd_draw_text(font, 10, 155, RGBA8(255, 0, 0, 255), 20, "Font drawing on the top screen!");
|
||||
sftd_draw_text(font, 10, 170, RGBA8(0, 255, 0, 255), 2, "Font drawing on the top screen!");
|
||||
sftd_draw_text(font, 10, 180, RGBA8(0, 0, 255, 255), 10, "Font drawing on the top screen!");
|
||||
sftd_draw_text(font, 10, 205, RGBA8(255, 255, 0, 255), 170, "Font drawing on the top screen!");
|
||||
|
||||
sf2d_end_frame();
|
||||
|
||||
sf2d_start_frame(GFX_BOTTOM, GFX_LEFT);
|
||||
|
||||
sftd_draw_text(font, 10, 10, RGBA8(0, 255, 0, 255), 20, "Font drawing on the bot. screen!");
|
||||
sftd_draw_text(font, 10, 30, RGBA8(255, 0, 0, 255), 10, "Font drawing on the bot. screen!");
|
||||
sftd_draw_text(font, 10, 50, RGBA8(0, 255, 0, 255), 15, "Font drawing on the bot. screen!");
|
||||
sftd_draw_text(font, 10, 70, RGBA8(0, 0, 255, 255), 5, "Font drawing on the bot. screen!");
|
||||
sftd_draw_text(font, 10, 90, RGBA8(255, 255, 0, 255), 25, "Font drawing on the bot. screen!");
|
||||
sftd_draw_text(font, 10, 120, RGBA8(255, 0, 255, 255), 20, "Font drawing on the bot. screen!");
|
||||
sftd_draw_text(font, 10, 140, RGBA8(0, 255, 255, 255), 12, "Font drawing on the bot. screen!");
|
||||
sftd_draw_text(font, 10, 150, RGBA8(255, 0, 0, 255), 28, "Font drawing on the bot. screen!");
|
||||
|
||||
sf2d_end_frame();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue