lite
lite copied to clipboard
How using C function to draw a text on screen?
Hello,
Anybody can help me creating example how drawing a text on screen?
i dunno how relevant this may be to the editor but what i do know for graphics related stuff, like making windows and rendering text to screen, people commonly use SDL2, especially when working with C
This is borderline related to lite. Anyways, let me google that for you @fab1an2
using lite engine?
I thought it was obvious. Yes, I would like to display the text with lite engine system C
@quadroli how fast is editor (benchmark) and trouble , errors
You should be using the methods on the "C-injected" renderer
table.
If you want an example, you can look at my memusage
plugin which uses the draw_text
function to display Lua's RAM usage.
Edit: This is the exact line I call it.
draw_text
is also exposed via common.draw_text
and can be required by require "core.common"
. This version provides some extra utilities such as alignment and returning the incremented stride instead of the stride alone.
I create a small repo. In future I create a benchmark (meybe convert to other g engine?) https://gitlab.com/0xtrzy/engine-tui/-/tree/master Question is why this code not working?
rencache_begin_frame();
rencache_draw_rect(male, czerwone);
rencache_draw_text(foncik, "żółw", 14, 2, kolorek);
rencache_end_frame();
(original comented https://gitlab.com/0xtrzy/engine-tui/-/blob/master/main.c )
Anybody can look at this repo and tell me why this code not showing text?