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.

sprite_get_bbox_left(ind) Returns the left side of the bounding box of<br />

the sprite <strong>with</strong> the given index.<br />

sprite_get_bbox_right(ind) Returns the right side of the bounding box<br />

of the sprite <strong>with</strong> the given index.<br />

sprite_get_bbox_top(ind) Returns the top side of the bounding box of<br />

the sprite <strong>with</strong> the given index.<br />

sprite_get_bbox_bottom(ind) Returns the bottom side of the bounding<br />

box of the sprite <strong>with</strong> the given index.<br />

sprite_get_bbox_mode(ind) Returns the bounding box mode<br />

(0=automatic, 1=full image, 2=manual) of the sprite <strong>with</strong> the given index.<br />

sprite_get_precise(ind) Returns whether the sprite <strong>with</strong> the given index<br />

uses precise collision checking.<br />

In certain situations you might want to save the bitmap corresponding to a particular<br />

subimage of the sprite to a file. For this the following function can be used:<br />

Sounds<br />

sprite_save(ind,subimg,fname) Saves subimage subimg of sprite ind to<br />

the file <strong>with</strong> the name fname. This must be a .bmp file. Only available in the<br />

Pro Edition.<br />

The following functions will give you information about a sound:<br />

sound_exists(ind) Returns whether a sound <strong>with</strong> the given index exists.<br />

sound_get_name(ind) Returns the name of the sound <strong>with</strong> the given index.<br />

sound_get_kind(ind) Returns the kind of the sound <strong>with</strong> the given index<br />

(0=normal, 1=background, 2=3d, 3=mmplayer).<br />

sound_get_preload(ind) Returns whether the sound <strong>with</strong> the given index<br />

has preload set.<br />

Sounds use many resources and most systems can store and play only a limited number of<br />

sounds. If you make a large game you would like to have more control over which sounds are<br />

loaded in audio memory at what times. You can use the switch off the preload option for<br />

sounds to make sure sounds are only loaded when used. This though has the problem that<br />

you might get a small hiccup when the sound is used first. Also, sounds are not automatically<br />

unloaded when you don't need them anymore. For more control you can use the following<br />

functions.

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

Saved successfully!

Ooh no, something went wrong!