此函数用来设置给定可视区域的Y坐标位置。你需要给出可视区域的索引(从0到7)和放置它的新位置。
view_set_yport(view_port, y)
参数 描述 view_port The view port to target (0 - 7) y The new y position
N/A(无返回值)
if view_get_yport(0) != (display_get_height() / 2) - (view_hport[0] / 2)
{
view_set_yport(0, (display_get_height() / 2) - (view_hport[0] / 2));
}
上述代码将会检查view port[0]的Y位置,如果不是所需要的,则将其设为所需要的位置。