我正在遵循Sara Spalding的RPG教程,似乎在Part 6:菜单视频中出现了问题。菜单技术上是正确的,但字体只有在我的光标上方才正确显示。任何索引在当前悬停值以下的选项都会被扭曲或膨胀。(手机截图附上,因为它在屏幕截图时会显示为全部白色。)
以下是我的oMenu对象的绘制事件代码:
draw_sprite_stretched(sprFlexBox, 0, x, y, widthFull, heightFull);
draw_set_color(c_white);
draw_set_font(TestFont);
draw_set_halign(fa_left);
draw_set_valign(fa_top);
var _desc = (description != -1);
var _scrollPush = max(0, hover - (visibleOptionsMax-1));
for (var l = 0; l < (visibleOptionsMax + _desc); l++){
if (l >= array_length(options)) {break;}
draw_set_color(c_white);
if (l == 0) && (_desc){
draw_text(x + xmargin, y + ymargin, description);
} else {
var _optionToShow = l - _desc + _scrollPush;
var _str = options[_optionToShow][0];
if (hover == _optionToShow - _desc){
draw_set_font(c_yellow);
}
if (options[_optionToShow][3] == false) {
draw_set_color(c_gray);
}
draw_text(x + xmargin, y + ymargin + l * heightLine, _str);
}
}
draw_sprite(sprPointerIcon, 0, x + xmargin, y + ymargin + ((hover - _scrollPush) * heightLine) + 7);
if (visibleOptionsMax < array_length(options)) && (hover < array_length(options)-1){
draw_sprite(sprDownArrow, 0, x + (widthFull * 0.5), y + heightFull - 7);
}
请提供任何建议将会非常感谢!
评论 (0)