Closed gtrxAC closed 3 years ago
Could you provide your example?
Like, in text rather than a vidoe?\
JS:
const rl = require('raylib');
const rec = rl.Rectangle(100, 100, 500, 500);
rl.InitWindow(1024, 768, "test");
while (!rl.WindowShouldClose()) {
rl.BeginDrawing();
rl.ClearBackground(rl.BLACK);
rl.DrawRectangleLinesEx(rec, 1, rl.RED);
rl.DrawTextRec(rl.GetFontDefault(), "hello world", rec, 10, 1, true, rl.WHITE);
rl.EndDrawing();
}
C equivalent:
#include "raylib.h"
Rectangle rec = {100, 100, 500, 500}
int main(void)
{
InitWindow(1024, 768, "test");
while (!WindowShouldClose()),
{
BeginDrawing();
ClearBackground(BLACK);
DrawRectangleLinesEx(rec, 1, RED);
DrawTextRec(GetFontDefault(), "hello world", rec, 10, 1, true, WHITE);
EndDrawing();
}
}
This issue is not specific to DrawTextRec
, it also occurs with DrawTextCodepoint
and probably other text functions that allow custom fonts.
Thanks! Found the issue on Fonts.
Using
DrawTextRec
causes the screen to glitch out, sometimes no text is drawn at all. The equivalent C program works fine. https://user-images.githubusercontent.com/59177874/112764993-b1ff2980-9013-11eb-8f39-86f4a59b4ae3.mp4Using a custom font looks like this:![screenshot000](https://user-images.githubusercontent.com/59177874/112765097-41a4d800-9014-11eb-9873-c47049b4f0ea.png)