View Issue Details

IDProjectCategoryView StatusLast Update
0026220RunnerSurfacesPublic2017-08-03 11:09
ReporterStewart BishopAssigned ToMike Dailly 
PriorityLowSeverityC - GeneralReproducibility100%
Status ClosedResolutionNo Change Required 
Product Version 
Target VersionFixed in Version 
Summary0026220: Surfaces: [GMS2] Drawing some text letter by letter after using draw_set_font butchers the text
DescriptionI got in trouble in drawing letters by letters on a surface.
When I add 'draw_set_font(font)', the font become strange.

There is no problem in drawing a sentence at a time or in a font file.

More information,
https://forum.yoyogames.com/index.php?threads/typewriting-font-on-a-surface-get-crashed.23347/#post-145100
Steps To Reproduce1) Import the project
2) Run it
3) See that this is fine
4) Within the create event for the object uncomment the draw_set_font
5) Run it again
6) See that the text has now been butchered
1.4 Found In
2.x Runtime Found In9.9.1.524
2.x Runtime Verified In2.1.0.124

Activities

Stewart Bishop

2017-04-17 15:57

Adminstrator  

Font corruption.yyz (27,909 bytes)

Mike Dailly

2017-05-19 13:32

Manager   ~0053259

Not a bug.

Your simply adding on the offset BEFORE drawing, so in effect your drawing the current current character to the location of the next one. Moving it all into the DRAW event...


draw_set_font(font_0);
surface_set_target(message_surf);
if ( char_n <= string_length(Message))
{
    _char = string_char_at(Message, char_n)
    draw_text(char_x, 0, _char);
    char_x += string_width(_char)
    char_n += 1 ;
}
surface_reset_target();

Works as expected.