This function can be used to retrieve the x position of the given view port.
view_get_xport(view_port)
| Argument | Description |
|---|---|
| view_port | The view port to target (0 - 7) |
Real
if view_get_xport(0) != (display_get_width() / 2) - (view_wport[0] / 2)
{
view_set_xport(0, (display_get_width() / 2) - (view_wport[0] / 2));
}
The above code will check the x position of the view port[0] and if it is not where it is required to be it is set to that position.