帮助,我刚开始使用game-maker studio,并且我使用了炉火野兽教程文本框,但是我的文本框不会写入文本,即使代码是相同的,并且框出现了,也没有错误消息。以下是代码
// draw the box
draw_set_alpha( .5 );
draw_roundrect_color( x, y, x+width, y+height, c_black, c_black, false );
draw_set_alpha( 1 );
// set the color to white
draw_set_color( c_white );
// line break
if ( string_width( str ) > width-padding-padding ) {
// remove the space and replace with line break
message = string_delete ( message, last_space, 1 );
message = string_insert ( "#", message, last_space );
ds_list_add( start, last_space+1 );
}
// make sure we didnt reach the end of the message
if ( count < string_length( message ) )
{
// are we at space, set last_space variable
if ( string_char_at( message, count ) == " " ) {
last_space = count;
}
// increment count
count ++;
}
// did we go past the bottom? move up a line
if ( string_height( str ) > height-padding ) {
line ++;
}
// grab the string
str = string_copy( message, ds_list_find_value( start, line ), count-ds_list_find_value( start, line ) );
发布于 2017-07-17 13:50:37
根据我所看到的,前4行绘制矩形,其余的操作字符串str
以适合矩形。但我没有看到像draw_text(x, y, str);
这样的东西,因为我设法用一些虚构的值初始化您的代码,然后设法在矩形上绘制str
(文本)。如果不是这样,那么我认为最好也发送对象的整个变量表,或者这个对象的任何其他绘制事件代码,其中包含您实际绘制字符串的方式。
https://stackoverflow.com/questions/45085297
复制相似问题