view_set_surface_id


描述

With this variable you can set the contents of a view port to draw to a surface. When working with surfaces, it is often required that capture the whole visible region of the screen to the surface, and so you would assign it to a view port using this function. This means that everything that is shown in the chosen port view will now be drawn to the assigned surface and the contents of that view port will no longer be displayed, meaning that you will need to either:

When using this function you give the view port index (from 0 to 7) and a surface index (either the application_surface or the unique index value returned by the function surface_create) or, if a surface has previously been assigned and you want to remove it, a value of -1. For further information on setting the view port to a surface see also the variable view_surface_id.


语法:

view_set_surface_id(view_port, surf)


参数:

参数 描述
view_port The view port to target (0 - 7)


返回:

Real(实数)


例如:

if view_get_surface_id(0) == -1
   {
   view_set_surface_id(0, global.vSurf);
   }

上述代码将会检查是否有表面被分配给view port[0],如果没有就分配一个。


上一页: Cameras
下一页: view_get_camera
© Copyright YoYo Games Ltd. 2018 All Rights Reserved