» Uncategorized Posts

view_get_hview

Returns the height of the current viewport.

Example, called from article1_update.gml:

// destroys articles out of the lower view side:
if (y > view_get_yview() + view_get_hview()) {
instance_destroy();
}

view_get_wview

Returns the width of the current viewport.

Example, called from article1_update.gml:

// destroys articles out of the right view side:
if (x > view_get_xview() + view_get_wview()) {
instance_destroy();
}

set_victory_theme

Overwrites character’s victory theme. Can be assigned to a custom sound using

sound_get( sound )  Reference→

or set to one of the following indexes

ArgumentTypeDescription
theme:realVictory theme index or custom sound ID

Example, called from load.gml:

set_victory_theme( sound_get( "custom" ));

sound_stop

Stops the specified sound if it’s playing.

Use either

asset_get( sound )  Reference→
sound_get( sound )  Reference→

to retrieve the ID.

ArgumentTypeDescription
soundID:realThe ID of the game sound to stop

Example, called from attack_update.gml:

// this attack plays a charging sound that stops when you release the charge:
if (window == 3 && window_timer == 1) {
sound_stop(sound_get( "charging_sound" ));
sound_play(sound_get( "release_sound" ));
}

sound_play

Plays the specified sound effect, supports both built-in and custom sounds. Returns the id of the sound played.

Use either

asset_get( sound )  Reference→ sound_get( sound )  Reference→

to retrieve the ID.

ArgumentTypeDescription
soundID:realThe ID of the game sound to play
looping:real(optional)
Whether to loop the sound or not. If set to true, be sure to save the id of the sound so you can later stop it with sound_stop( sound ) Reference→
panning:real(optional)
The panning of the sound. Should be between -1 and 1. Using the keyword noone will use normal panning.
volume:real(optional)
The volume of the sound. Should be between 0 and 1.
pitch:real(optional)
The pitch of the sound, in multiples. 2 will play the sound at double pitch, 0.5 at half pitch, and so on.

Example, called from attack_update.gml:

if (attack == AT_NSPECIAL) {
if (window == 4 && window_timer == 1) {
sound_play( sound_get( "custom" ) );
}
}