## Useful Functions Extension

Posted by tigerman on July 25, 2010
This extension allows full use to 45 functions and 127 constants. There are 7 groups of functions. The first group is the note group, this allows easy access to well, mostly note names and frequencies. The next group is the time group, including functions for finding the name of month, name of season, and name of weekday. The third group is the math group (called integer) it allows the creation of fractions, simplifying fractions, and the lowest common denominator stuff. The fourth group are some useful string unctions I've added. The fifth group are some new file text functions including file_text_read_string_all which reads all the lines. The sixth group are some easy sound functions. Note: they doesn't use the original game maker sound equation, it uses a more reliable equation I made. And last but not least, the miscellaneous group, including my favorite function: draw_flip_set_identity.

(The following are some of the functions used in this extension)

### » Add a Screenshot

### Functions:

Notes are new to introduce to Game Maker, and very useful. The only way I found that could export them into sound was the function beep() that's somebody elses (you also need duration in milliseconds too). (note[group]_[key][letter])

Returns **Note Values**

Returns **Month Name**

Returns **Season Name**

Returns **Weekday Name**

Too bad this cannot be a constant...

Returns **Season Number**

Really Helpful if you are using variables in frequency

Returns **Frequency**

To make sure you have the right note

Returns **Name of Note With Group Number**

Groups mostly mean pitches

Returns **Group Number**

This function creates a fraction , and could give it back to you as the numerator or the denominator. Argument0 is the integer [0=none], argument1 is the constant (The part that starts from the decimal and ends at the repeater. [-1=none]), argument2 is the repeater (The part that repeats it's self behind the decimal. [0=none]). (The equation is mine, actually everything is mine from scratch except for the 'text_to_speech_play')

Returns **Numerator, or Denominator (Argument4)**

This function rounds a fraction, and would give it back to you as the numerator or the denominator. (Argument0 has to be larger than the output numerator)

Returns **Numerator, or Denominator (Argument2)**

Returns **Rounds x to the Nearest Grid Marker**

Returns **Flips a String**

Returns **Reads All Lines of a File**

Returns **Opens and Reads All the Lines of a File**

Returns **Sound File**

Returns **Plays a Sound With the Option of Looping it**

Note: this doesn't use the original game maker sound equation, it uses a more reliable equation I made.

Returns **Sets the Volume Percentage of a Sound**

Returns **Stops Each Sound**

I found this function on Google, e-mail me if you want it as a function, and not as an extension. (The only function that's not mine)

Returns **Plays Voice**

This was really hard to conjure up. It flips (Not rotates!) everything that follows. (Not fully tested) Note: Everything that follows has to have an x and y value of 0, while they appear on the function. In order to do separate sprites or backgrounds with different positional values, end it with 'draw_flip_set_identity(FALSE)' and restart it with 'draw_flip_set_identity(TRUE,xt,yt,horizontal,vertical)' Also, I think the images positional display values would be altered in relation to the flipping method (Like you would rotate a sprite with an margin of (0,0)).

Returns **Flips the Following**

Really handy in decryption

Returns **Character Code of a Character**

Returns **Inverted Color**

Just because I use it a lot

Returns **Draws Text at Centered Position**