• 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 typewriting font on a surface get crashed

R

Re_hei

Guest
Hello, I'm trying to set up my text engine but now I have a problem.
My text engine works by drawing letters by letters in a surface.


<Create>
Message[0] = "Hello, my name is Mrs.Green"

char_x = 0 //the x position where the letter would be drawn.
message_surf = surface_create(300, 300)

_char = "" //the letter which would be drawn this time.


<Step>
if ( i < string_length(Message[0])); {
_char = string_char_at(Message[0], i)
char_x += string_width(_char)
i += 1 ;
}


<Draw>
surface_set_target(message_surf);
draw_text(char_x, 0, _char);
surface_reset_target();



Like this. It works well.
good.jpg

But when I add "draw_set_font(font)" in <Create>, the font get massed.
The image of font which is drawn in a surface get crashed.

bad.jpg

Is there anyone who knows the solution of this problem?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Have you tested with various fonts? It could be that the font you are using is corrupt in some way.... However, if the font you are using is a standard font or you are sure it's fine, then you should make a sample project and then file a bug with a link to the project as using draw_set_font should not corrupt how things are displayed. https://account.yoyogames.com/report-bug
 
R

Re_hei

Guest
Have you tested with various fonts? It could be that the font you are using is corrupt in some way.... However, if the font you are using is a standard font or you are sure it's fine, then you should make a sample project and then file a bug with a link to the project as using draw_set_font should not corrupt how things are displayed. https://account.yoyogames.com/report-bug
Yes, there is no problem in fonts. I tried with various fonts.
There is no problem when I draw a sentence at a time, too.

I reported this font corruption. Thank you.
 
Top