view_set_surface_id


Description

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.


Syntax:

view_set_surface_id(view_port, surf)


Arguments:

Argument Description
view_port The view port to target (0 - 7)


Returns:

Real


Example:

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

The above code will check to see if a surface has been assigned to the view port[0] and if it has not then one is assigned.


Back: Cameras
Next: view_get_camera
© Copyright YoYo Games Ltd. 2017 All Rights Reserved