首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >game maker studio文本框写入错误

game maker studio文本框写入错误
EN

Stack Overflow用户
提问于 2017-07-13 23:34:37
回答 1查看 116关注 0票数 0

帮助,我刚开始使用game-maker studio,并且我使用了炉火野兽教程文本框,但是我的文本框不会写入文本,即使代码是相同的,并且框出现了,也没有错误消息。以下是代码

代码语言:javascript
运行
复制
// 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 ) );
EN

回答 1

Stack Overflow用户

发布于 2017-07-17 13:50:37

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45085297

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档