0

帮助,我是使用游戏制作工作室的新手,我遵循壁炉野兽教程文本框,但即使代码相同并且出现框,我的文本框也不写文本,也没有错误消息。这是代码

// 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 ) );
4

1 回答 1

0

据我所知,前 4 行绘制矩形,其余操作字符串str以适应矩形。但是我没有看到draw_text(x, y, str);类似的情况,因为我设法用一些组成的值初始化您的代码,然后设法str在矩形上绘制(文本)。如果不是这种情况,那么我认为最好也为您的对象发送整个变量表,或该对象的任何其他绘制事件代码,其中包含您实际绘制字符串的方式。

于 2017-07-17T05:50:37.003 回答