view_current

Returns the current view being rendered.

Syntax:

view_current


Returns: Real


Description

This read only variable is only valid in the Draw Event and returns the current view being rendered. The return value will change during the draw event when you have various views as the draw event is called once for each view in succession. So when (for example) you are using view[0] and view[1] in your game room, the draw event for ALL instances will be run twice, once for each view, and with this variable you can check to see what view is currently being drawn. In general, this is used to only render specific details to a single view when multiple views are visible in the room at the same time. See the example code below.


Example:

if view_current == 0
   {
   draw_text(view_xview[0] + 32, view_yview[0] + 32, "Player 1");
   }
else
   {
   draw_text(view_xview[1] + 32, view_yview[1] + 32, "Player 2");
   }

The above code checks to see which view is currently being drawn and then draws a different text to each view based on the return value.


Back: Views
Next: view_visible
© Copyright YoYo Games Ltd. 2018 All Rights Reserved