S3D_DRAW_STRING(3)

πŸ’– S3D_DRAW_STRING πŸ’–

okay bestie, welcome to the s3d manual, page S3D_DRAW_STRING(3) β€” yes it's a whole section 3 function page, we're in library land now πŸ‘‘


✨ NAME ✨

s3d_draw_string β€” draw a simple string πŸŽ€


🌸 SYNOPSIS 🌸

#include <s3d.h>

int s3d_draw_string(const char *str, float *xlen);

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically it renders the string str in Truetype format with the height 1, and then it hands you back the length of the rendered string in *xlen β€” or, if you literally do not care, set len=NULL to disable that whole thing πŸ™ˆ

here's the vibe, fr fr:

char str="hello world!";
float len;
s3d_select_font("vera");
s3d_draw_string(str, len);

// not interested in the length? do that: s3d_draw_string(str, NULL);
not me writing a whole string and then passing NULL because I only wanted the pixels, not the receipts πŸ’…

πŸ‘‘ AUTHOR πŸ‘‘

Simon Wunderlich

  • Author of s3d ⭐

and that's the whole page, bestie β€” no cap, every single detail is right there 🫢

this came straight out of the s3d manual, page S3D_DRAW_STRING(3) β€” go forth and draw strings, you main character πŸŒˆπŸ’œ