view_hport

This variable can be used to get or to set the height of the specified view port. The height of the view port (or combined view ports if more than one are active) define the height of the game window or background canvas at the start of the game, so changing this value after the game has started will have no visible effect on the game window size unless called along with the function window_set_size(). If you have a larger or smaller port size than that assigned to the camera, then the camera view will be scaled down - or up - to fit, as illustrated by the image below.

NOTE This variable does not hold a real GML array, so you cannot run any array functions on it or serialise it (convert it to a string). The only operation you can run on it is accessing a value at an index, with the view_hport[index] syntax.

view_hport example

 

Syntax:

view_hport[0 ... 7]

 

Returns:

Real

 

Example:

camera_set_view_size(view_camera[0], view_wport[0], view_hport[0]);

The above code sets the width and height of the camera view to be the same as the width and height of the view port.