window_set_position

Sets the position of the window inside the browser/visible area of the screen.

Syntax:

window_set_position(x, y);


Argument Description
x The x coordinate of where to position the window.
y The y coordinate of where to position the window.


Returns:N/A


Description

With this function you can set the game window to a specific position within the display (on MacOS, Linux(Ubuntu) and Windows) or within the browser (HTML5).

NOTE: If your HTML5 game uses a custom index.html and that sets the canvas to a fixed position then this function will have no effect on the window position.


Example:

window_set_position(0, 0);

The above code will position the game window in the upper left corner of the browser or display (depending on the target module being used).


Back: The Game Window
Next: window_set_size
© Copyright YoYo Games Ltd. 2017 All Rights Reserved