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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

indicated depth to the new depth. With this function you can move whole tile<br />

layers to a new depth.<br />

The display<br />

The display represents the whole area on the monitor. It has a size (typically 1024x768, or<br />

1280x1024), a color depth, that is, the number of bits that are used to represent a single pixel<br />

(typically 16 = High Color or 32 = Full Color) and a refresh frequency, that is, the number of<br />

times per second the display is refreshed (typically between 60 and 120). These settings can<br />

normally be changed though the display properties. For games though, in particular when they<br />

run in full-screen mode, it is important to be able to change these settings. All these settings<br />

can be initialized for the game in the <strong>Game</strong> Settings. For use during game play the following<br />

functions exist. Note though that changing the settings during game play will result in a time<br />

delay as things has to be rebuilt. The functions to set the mode are only available in the<br />

Pro Edition.<br />

display_get_width() Returns the width of the display in pixels.<br />

display_get_height() Returns the height of the display in pixels.<br />

display_get_colordepth() Returns the color depth in bits.<br />

display_get_frequency() Returns the refresh frequency of the display.<br />

display_set_size(w,h) Sets the width and height of the display in pixels.<br />

Returns whether this was successful. (Realize that only certain combinations<br />

are allowed.)<br />

display_set_colordepth(coldepth) Sets the color depth. In general<br />

only 16 and 32 are allowed values. Returns whether successful.<br />

display_set_frequency(frequency) Sets the refresh frequency for the<br />

display. Only few frequencies are allowed. Typically you could set this to 60<br />

<strong>with</strong> a same room speed to get smooth 60 frames per second motion. Returns<br />

whether successful.<br />

display_set_all(w,h,frequency,coldepth) Sets all at once. Use -1 for<br />

values you do not want to change. Returns whether successful.<br />

display_test_all(w,h,frequency,coldepth) Tests whether the<br />

indicated settings are allowed. It does not change the settings. Use -1 for<br />

values you do not want to change. Returns whether the settings are allowed.<br />

display_reset() Resets the display settings to the ones when the program<br />

was started.

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

Saved successfully!

Ooh no, something went wrong!