You are not logged in.
Pages: 1
References: [1]
draw_text_ext is often used to wrap strings however when using a word longer than the stated string width it will not split it up as it only splits the string up at spaces or - characters. You can use this replacement function to get the proper functionality:
//draw_text_ext2(x,y,str,sep,w)
var str;
str = argument2;
if (string_width_ext(str,argument3,argument4) > argument4)
{
var i;
for (i = 1; i <= string_length(str); i += 1)
{
if (string_width_ext(string_copy(str,1,i),argument3,argument4) > argument4)
{
str = string_insert(chr(13),str,i);
}
}
}
draw_text_ext(argument0,argument1,str,argument3,argument4);
Last edited by flexaplex (2009-06-16 08:30:55)
Offline
Pages: 1