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.
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.
Is there anyone who knows the solution of this 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.
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.
Is there anyone who knows the solution of this problem?