You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running into an issue when printing text using DrawTextEx. The font size is over ridden by the y member of the Vector2 struct. As you increase position.y the text size increases.
Not sure if this is a raylib issue, a zig issue, or a me issue.
Code Example
constfont: raylib.Font=raylib.LoadFont("assets/fonts/Vermin Vibes 1989.ttf"); // or any other font...constx: f32=10;
consty: f32=10;
constposition=raylib.Vector2{ .x=x, .y=y };
...raylib.DrawTextEx(font, "Hello World", position, 8.0, 1.0, raylib.BLUE);
GDB Step Through
When I walk through DrawTextEx in GDB we can see the Vector2 somehow loses its y value and that value ends up shifting the fontSize parameter into the spacing parameter.
Before we enter DrawTextEx we can see that position is still `{x=10,y=10}
(gdb) p position
$1 = {x = 10, y = 10}
The call to enter position is wrong. The fontSize should be 8 and the spacing should be 1.
(gdb) s
DrawTextEx (font=..., text=0x20c702 <game-state-example.gameloop.anon_3209> "Hello World", position=..., fontSize=10, spacing=8, tint=...)
at raylib-zig/raylib/src/rtext.c:1030
Looking at position from within DrawTextEx we can see that position.y has been set to 0
(gdb) p position
$2 = {x = 10, y = 0}
As we saw from the call to Draw Text ExfontSize is 10 and spacing is 8. These should be 8 and 1 respectivly
(gdb) p fontSize
$3 = 10
(gdb) p spacing
$4 = 8
I cant tell if there is an issue with tint, the struct signature looks a little off.
(gdb) p tint
$5 = {r = 0'\000', g = 121'y', b = 241'\361', a = 255'\377'}
(gdb)
GDB Disassembly
Disassembling the lead into the DrawTextEx function yields:
Running into an issue when printing text using
DrawTextEx
. The font size is over ridden by they
member of theVector2
struct. As you increaseposition.y
the text size increases.Not sure if this is a raylib issue, a zig issue, or a me issue.
Code Example
GDB Step Through
When I walk through
DrawTextEx
in GDB we can see theVector2
somehow loses its y value and that value ends up shifting thefontSize
parameter into thespacing
parameter.Before we enter
DrawTextEx
we can see that position is still `{x=10,y=10}The call to enter position is wrong. The
fontSize
should be 8 and thespacing
should be 1.Looking at position from within
DrawTextEx
we can see thatposition.y
has been set to 0As we saw from the call to
Draw Text Ex
fontSize
is 10 andspacing
is 8. These should be 8 and 1 respectivlyI cant tell if there is an issue with
tint
, the struct signature looks a little off.GDB Disassembly
Disassembling the lead into the
DrawTextEx
function yields:edit: extracted position to demonstrate issue via GDB
The text was updated successfully, but these errors were encountered: