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.

holds. (The name must exist. Otherwise the number 0 is returned.)<br />

registry_exists(name) Returns whether the given name exists.<br />

Actually, values in the registry are grouped into keys. The above routines all work on values<br />

<strong>with</strong>in the key that is especially created for your game. Your program can use this to obtain<br />

certain information about the system the game is running on. You can also read values in<br />

other keys. You can write them also but be very careful. YOU CAN EASILY DESTROY YOUR<br />

SYSTEM this way. (Write is not allowed in secure mode.) Note that keys are again placed in<br />

groups. The following routines default work on the group HKEY_CURRENT_USER. But you can<br />

change the root group. So, for example, if you want to find out the current temp dir, use<br />

path = registry_read_string_ext('\Environment','TEMP');<br />

The following functions exist.<br />

INI files<br />

registry_write_string_ext(key,name,str) Creates an entry in the<br />

key in the registry <strong>with</strong> the given name and string value.<br />

registry_write_real_ext(key,name,x) Creates an entry in the key in<br />

the registry <strong>with</strong> the given name and real value.<br />

registry_read_string_ext(key,name) Returns the string that the given<br />

name in the indicated key holds. (The name must exist. Otherwise an empty<br />

string is returned.)<br />

registry_read_real_ext(key,name) Returns the real value that the<br />

given name in the indicated key holds. (The name must exist. Otherwise the<br />

number 0 is returned.)<br />

registry_exists_ext(key,name) Returns whether the given name exists<br />

in the given key.<br />

registry_set_root(root) Sets the root for the other routines. Use the<br />

following values:<br />

0 = HKEY_CURRENT_USER<br />

1 = HKEY_LOCAL_MACHINE<br />

2 = HKEY_CLASSES_ROOT<br />

3 = HKEY_USERS

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

Saved successfully!

Ooh no, something went wrong!