Mantis

View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0026220RunnerSurfacesPublic2017-04-17 15:572017-05-19 13:49
ReporterStewart Bishop 
Assigned ToMike Dailly 
PriorityLowSeverityC - GeneralReproducibility100%
StatusResolvedResolutionNo Change Required 
PlatformOSOS 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 Version
2.x Runtime Version9.9.1.524
2.x Runtime Version Verified In
Attached Files? file icon Font corruption.yyz [^] (27,909 bytes) 2017-04-17 15:57

- Relationships

-  Notes
(0053259)
Mike Dailly (Manager)
2017-05-19 13:32

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.


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker