Thanks, I already report the bug.In fact the chinese not need space,each character just like the word in English.In GMS2 and GMS1 Previous version.The draw_text_ext works fine.Please fix it soon.I can confirm that draw_text_ext is expecting spaces at word breaks - please file a bug with the specific strings you are seeing (we had not considered chinese and eastern languages when it was designed). In the meantime add a few spaces into the chinese text where the linebreaks should be on roll your own code to measure the strings and add the spaces at the correct locations.
Russell
///draw_txt_warp(x,y,txt,sep,w);
var xx,yy,vtxt,vsep,vww,vth,vhh;
vth=0;
xx=argument0;
yy=argument1;
vtxt=argument2;
vsep=argument3;
vww=argument4;
vhh=string_height(vtxt);
vlen=string_length(vtxt);
var i=1;
var j=1;
repeat vlen{
var vcut = string_copy(vtxt,1,j);
if i==vlen{
draw_text(xx,yy+vth,vtxt);
vth+=vsep;
}else if string_width(vcut)>vww{
var vj=max(1,j-1);
vcut = string_copy(vtxt,1,vj);
draw_text(xx,yy+vth,vcut);
vtxt = string_delete(vtxt,1,vj);
vth+=vsep;
j=0;
}
i+=1;
j+=1;
}
return vth;
this bug also cause me a lot of troubleThanks, I already report the bug.In fact the chinese not need space,each character just like the word in English.In GMS2 and GMS1 Previous version.The draw_text_ext works fine.Please fix it soon.
And now I edit a script to warp chinese for now.
Code:///draw_txt_warp(x,y,txt,sep,w); var xx,yy,vtxt,vsep,vww,vth,vhh; vth=0; xx=argument0; yy=argument1; vtxt=argument2; vsep=argument3; vww=argument4; vhh=string_height(vtxt); vlen=string_length(vtxt); var i=1; var j=1; repeat vlen{ var vcut = string_copy(vtxt,1,j); if i==vlen{ draw_text(xx,yy+vth,vtxt); vth+=vsep; }else if string_width(vcut)>vww{ var vj=max(1,j-1); vcut = string_copy(vtxt,1,vj); draw_text(xx,yy+vth,vcut); vtxt = string_delete(vtxt,1,vj); vth+=vsep; j=0; } i+=1; j+=1; } return vth;
putting whitepsace in is the easiest approach. you can also programmatically iterate through characters in the string, while checking for the width, and if the width exceeds the maximum, insert whitespace.Apologize if I resume this dead post. Is there a way to solve the problem without writing a custom script? I'm considering to manually put some white spaces.