• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code Is draw_set_halign still the way to go?

P

Pixelguin

Guest
Edit: Decidedly a bug.

I've been trying to draw text in the center of the screen. To test alignment I used this code:

Code:
///@desc Draw centered(?) text
draw_set_valign(fa_middle);
draw_set_font(fTest); //96pt Tahoma if that matters

draw_set_halign(fa_right);
draw_set_color(c_blue);
draw_text(room_width/2,room_height/2,"Hello");

draw_set_halign(fa_left);
draw_set_color(c_red);
draw_text(room_width/2,room_height/2,"Hello");

draw_set_halign(fa_center);
draw_set_color(c_black);
draw_text(room_width/2,room_height/2,"Hello");
When used in GMS 1.4, this code worked exactly as I expected: black text appeared in the middle center of the screen and colored text to the sides. However, in GMS 2, this same code seems shifted to the bottom-right somewhat.

Have I missed a new standard in text alignment or have I found a genuine bug? I would think that this kind of issue would be well-documented since almost every game uses text which is why I'm hesitant to submit a report right away.
 
Last edited by a moderator:

Edoc'sil

Member
This is what I get with your exact code (and 96pt Tahoma). I'm not sure I'm seeing what you are exactly but it DOES look like it isn't exactly the center vertically.

 
P

Pixelguin

Guest
I'll post screenshots when I can. Mine looks similar to yours but is also misaligned horizontally.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
If you think there is an issue with the alignment, please make your test projects available to the devs and file bug (in GMS2, Help > File a Bug)...
 
P

Pixelguin

Guest
Is that confirmation that this is indeed a bug? I posted it here first to make sure since YYG undoubtedly has their hands full with bug reports.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
No, I can't confirm as I haven't tested, but that image posted certainly doesn't look right and if two users agree that something isn't right then it's worth filing as a possible issue. :)
 
Top