Get View Variable Icon Get View Variable

This action permits you to get the value of certain built in variables related to a given view port. You select the view port variable to retrieve, then give the view port to target (from 0 to 7) and finally the target variable to hold the returned value (this can be flagged as being a temporary local variable). The view port is the area of the screen that will be used to draw a given camera view (as set up in the room editor), and the different variables that you are able to get in this way are outlined in the table below:

VariableDescription
CameraThe value returned will be the unique ID value of the camera to assigned to the port (see here for more information).
VisibilityThis will return a value of true or false where true is that the view port is visible (ie: it being drawn to the screen), and false meaning that nothing is being drawn.
View Port X CoordinateThis is the X position of the view port within the game window.
View Port Y CoordinateThis is the Y position of the view port within the game window.
View Port WidthThis is the width (in pixels) of the view port.
View Port HeightThis is the height (in pixels) of the view port.
View Port Surface IDThis will return the unique ID value for the surface assigned to the view port or -1 if no surface has been assigned.

 

Action Syntax:

Get View Variable Action

Arguments:

ArgumentDescription
VariableThe built in view variable to get
ViewThe view port to target (from 0 - 7)
TargetThe target variable to hold the returned value (can be flagged as a temporary local variable)

 

Example:

Get View Variable ExampleThe above action block code gets the current camera ID assigned to view port [0] and then checks to see if it is the same as the one stored in a global variable. If it is not, the camera is set to the new one.