Options Menu by Eggbert

From Spheriki

Jump to: navigation, search

OptionsMenu.js is a script by Eggbert. It can be used to make simple options menus similar to the ones in the original Pokemon games.

You can download it here.


Contents

Usage

OptionsMenu(options_array, current_options_array, x, y, width, height)

options_array: The array of options, of the form: ["option title", "choice one", "choice two"];

current_options_array: The array containing the current options. Using the array above, if "choice two" is chosen, current_options_array would look like current_options_array[1].
x, y, width, and height are fairly self explanatory.

Screenshot

Options menu.png

Example

 RequireScript("OptionsMenu.js");
 
 function game() {
 var options_file = OpenFile("options.txt");
 var options = [];
 options[0] = ["Option Title", "Choice 1", "Choice 2"]; //for each option
 
 var curr_options = options_file.read(options[0][0], 0)]; //the current options, stored as array indices.
 
 OptionsMenu(options, curr_options, 15, 15, GetScreenWidth()/2, GetScreenHeight()/3)
 }

I will eventually create decorations, like sliding, fading ,etc.

See also

Personal tools