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