MirthKit Dictionary

From MirthKit

Jump to: navigation, search

This is a list of all of the functionality available in MirthKit. Functions range from drawing, to sound, to networking, to input, and more. They are all global-scope functions; MirthKit's API is not object oriented.

Contents

[edit] Overview

This is a list of all of the functionality in MirthKit. Click blue links to view more information on a function (red ones don't have a full documentation page yet -- feel free to add one before we do). For more information about the Squirrel language, see the project's website, http://www.squirrel-lang.org.

[edit] Control

[edit] MirthKit Functions

  • update() - Updates internal subsystems. Returns width and height of the screen in an array.
  • flush() - Flushes all internal subsystem caches.
  • progress(current,total) - Sets the http download screen to display a particular progress. Pass -1,-1 to reset to default progress mode.
  • version() - Returns an array containing major and minor version numbers.
  • background(red,green,blue) - Sets the color that update() clears to.

[edit] Code Generation

  • doNut(filepath) - Very important! This is how you make MirthKit aware of code in other files. Like #include in C++ and import in Java.
  • loadNut(filepath) - Compiles a nut file and returns the compiled file as a function.
  • compilestring(string) - Compiles the squirrel code inside string into a returned function.

[edit] Time

  • millis() - Returns the current time in milliseconds.
  • micros() - Returns the current time in microseconds.

[edit] Graphics

[edit] Drawing

[edit] Transform

[edit] Brush

[edit] Advanced Triangles

[edit] Sound

[edit] Input

[edit] Mouse

  • mouse() - Returns an array with the position of the mouse.
  • mouseButton(buttonNumber) - Returns whether the button is currently pressed. Left=1, Middle=2, Right=3
  • cursor(showCursor) - Show the opperating system's cursor or not. This will not lock the mouse to inside of the window.

[edit] Keyboard

  • key(keyCode) - Returns whether the key is currently pressed. ASCII codes directly map to their keyCode equivallent.
  • rawKey(keyCode) - Returns whether the key is currently pressed. This doesn't go through the binding system as the above function does.
  • keyCode(keyName) - Find what the code of a key is. KeyNames are in all caps.
  • keyName(keyCode) - Get the name of a key from its key code.
  • catchKey() - Returns the keyCode of a key that is currently pressed. If you don't know the keyName of a key, use this in a test program to find it.
  • catchType() - Returns a list of the keys that are currently being pressed. (array of keyCodes)
  • modifiedKey(keyCode) - Returns keyCode, but as a shift-filtered ascii character, represented as an integer. It converts letters to uppercase, and numbers to their qwerty-shifted equivalents. Use .tochar() on the integer to process it with strings.
  • bind(keyCode,bindedKeyCode) - Whenever keyCode is pressed in the future, key(...) will actually return that bindedKeyCode is pressed.
  • binding(keyCode) - Returns what key keyCode is bound to.

[edit] Data Processing

[edit] Command Line Output

  • print(string) - Prints the string to the command line (stdout.txt in MirthKit's executable directory). Great for debugging.

[edit] Networking

[edit] HTTP

  • http(url) - Returns the specified url's response in a string. This function does not cache results.

[edit] Persistent Storage

[edit] Compression

[edit] Encryption

[edit] File Input/Output

These functions are only loaded while Developer Mode is active. They are designed to be used for level editors or similar.

[edit] Basic User Interface

[edit] Strips

[edit] Content

[edit] Buttons

[edit] Language

[edit] Most Objects

[edit] String

[edit] Table

[edit] Array

[edit] Squirrel Information

For information about the language used in these examples, see Squirrel.

Personal tools