08.11.2012 Views

Designing Games with Game Maker - YoYo Games

Designing Games with Game Maker - YoYo Games

Designing Games with Game Maker - YoYo Games

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

window_default() Gives the window the default size and position<br />

(centered) on the screen.<br />

window_get_x() Returns the current x-coordinate of the window.<br />

window_get_y() Returns the current y-coordinate of the window.<br />

window_get_width() Returns the current width of the window.<br />

window_get_height() Returns the current height of the window.<br />

Again, you probably never want to use any of the window positioning functions as <strong>Game</strong><br />

<strong>Maker</strong> takes care of these automatically.<br />

In rare cases you might want to know the position of the mouse <strong>with</strong> respect to the window.<br />

(Normally you always use the mouse position <strong>with</strong> respect to the room or <strong>with</strong> respect to a<br />

view.) The following functions exist for this.<br />

Views<br />

window_mouse_get_x() Returns the x-coordinate of the mouse in the<br />

window.<br />

window_mouse_get_y() Returns the y-coordinate of the mouse in the<br />

window.<br />

window_mouse_set(x,y) Sets the position of the mouse in the window to<br />

the indicated values.<br />

As you should know you can define up to eight different views when designing rooms. A view<br />

is defined by its view area in the room and its viewport on the screen (or to be precise in the<br />

drawing region <strong>with</strong>in the window). Using views you can show different parts of the room at<br />

different places on the screen. Also, you can make sure that a particular object always stays<br />

visible.<br />

You can control the views from <strong>with</strong>in code. You can make views visible and invisible and<br />

change the place or size of the views in the drawing region or the position and size of the view<br />

in the room (which is in particular useful when you indicate no object to be visible). You can<br />

change the size of the horizontal and vertical border around the visible object, and you can<br />

indicate which object must remain visible in the views. The latter is very important when the<br />

important object changes during the game. For example, you might change the main<br />

character object based on its current status. Unfortunately, this does mean that it is no longer

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!