Monkey
Store
Community
Apps
Contact
Login or Signup

ioPlus module

Monkey Programming Forums/User Modules/ioPlus module

Aman(Posted 1+ years ago) 
This is a module that does some basic file input&output. It also adds support to the native Windows Phone 7 keyboard (Not perfect though). And it has a two, or one button notification dialog.

It has the following functions:

void showAlert(string title, string message, bool twoButtons, string Button1, string Button2)

description: opens a notification dialog with one or two buttons. To get the result(a string that contain the text of the pressed button), use the getClickedButton() function.
Supported targets: XNA, Android, Flash(Not complete)

string getClickedButton()

description: Used to get the result of the ShowAlert() funtion. It returns a string that contain the text of the pressed button. After it is called. result will be reset to "Not intiated yet".
Supported targets: XNA, Android

void showXNAKeyboard(string title, string prompt, string defaultText)

description: XNA virtual keyboards is not supported in monkey. This will toggle the keyboard. To get the result (a string that has the typed content), use the getKeyboardInput() function.
Supported targets: XNA only (Tested on WP7)

string getKeyboardInput()

description: Used to get the result of the showKeyboard funtion. It returns a string that contains the text typed by the user. After it is called. result will be reset to "Not intiated yet".
Supported targets: XNA only (Tested on WP7)

string loadStringFromFile(string filename)

description: reads a file and return its content as a file. If the file does not exit, it will create it.
Supported targets: XNA, Android, GLFW

void saveStringToFile(string message, string filename)

description: write a string to a file. If the file does not exit, it will create it. Does not append data, it writes over them. If you want to append content to a file, use loadStringFromFile first.
Supported targets: XNA, Android, GLFW

Warning: I did this really fast. It has been a long time since I worked on them. There might be a bug here or there and there is plenty of room for enhancements.

I created a Google Project page here:
http://code.google.com/p/monkey-ioplus

You can download the module from here: http://monkey-ioplus.googlecode.com/files/ioPlus.zip
Alternative Link: http://www.2shared.com/file/9ObqQhz6/ioPlus.html