Skip to content

Font text is partially jumbled when using sprites with a font with sizes that differ (and when doubling the size of the window) #595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Drillimation opened this issue Jan 27, 2025 · 2 comments
Labels

Comments

@Drillimation
Copy link

I'm using a font at 12pt (or pixels), complete with a sprite that is 16 pixels tall. When mixing the two together (even when using a drop shadow), the font appears to be partly jumbled with it being pushed one or two pixels off. I'm producing the game in a low resolution that automatically sizes itself to the size of the user's monitor. The below picture is what happens.

Image

I'm using the following code to generate the example in the picture above.
draw_sprite_stretched(spr_textbox,0,view_xview + 0,view_yview + 192,256,80);
 
scribble_object[0] = scribble(text)
.starting_format("drp_shd",make_color_rgb(255,255,255))
.wrap(240)
.line_spacing(16)
.align(fa_left, fa_top)
.draw((view_xview + 8) + 1, (view_yview + 200) + 1,typist)
 
draw_set_font(global.sprite_font[1]);
draw_set_halign(fa_center);
draw_set_color(make_color_rgb(255,255,255));
draw_text(view_xview + 128,view_xview + 16,"HOW TO PLAY")

@JujuAdams
Copy link
Owner

Could you verify that view_yview is an integer, preferably by floor()ing those values before putting them into the draw coordinates.

@Drillimation
Copy link
Author

I tried to floor the value, even in the Create event, but the text still comes out jumbled. A line only displays correctly if a sprite is not present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants