System/Libraries/Graphics2D: Specify font name for Text2D
This commit is contained in:
parent
9c43ac1073
commit
a58151430c
2 changed files with 5 additions and 2 deletions
|
@ -1,3 +1,5 @@
|
|||
JsonObject* Fonts = Json.CreateObject(adam_task);
|
||||
|
||||
#define C2D_MAGIC 0xDEDEDEDEDEDEDEDE
|
||||
|
||||
class @context2d
|
||||
|
@ -1124,8 +1126,9 @@ I64 Print2D(Context2D* ctx, BitmapFont* font, I64 x, I64 y,
|
|||
return retval;
|
||||
}
|
||||
|
||||
U0 Text2D(Context2D* ctx, stbtt_fontinfo* font, I64 x, I64 y, I64 size, U32 color, U8* text)
|
||||
U0 Text2D(Context2D* ctx, U8* font_name, I64 x, I64 y, I64 size, U32 color, U8* text)
|
||||
{
|
||||
stbtt_fontinfo* font = Fonts->@(font_name);
|
||||
if (!ctx || !ctx->width || !ctx->height || !font || !size || !text || !StrLen(text)) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -58,10 +58,10 @@ load_elf("M:/build/bin/tlse");
|
|||
#include "Libraries/BitmapFont";
|
||||
#include "Libraries/Display";
|
||||
#include "Libraries/FileSystem";
|
||||
#include "Libraries/Json";
|
||||
#include "Libraries/Graphics2D";
|
||||
#include "Libraries/Animation2D";
|
||||
#include "Libraries/Image";
|
||||
#include "Libraries/Json";
|
||||
#include "Libraries/Rsa";
|
||||
#include "Libraries/Sha256";
|
||||
#include "Libraries/System";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue