Module LM.GUI

LM.GUI is a user interface module that is built on top of Anime Studio's cross-platform user interface library. Scripts can use the user interface widgets in this module to build dialog boxes, and to set up custom interfaces for toolbar buttons.

Methods:

Name Returns Description Ver
Alert Alert(alertType, str1, str2, str3, but1, but2, but3) int Presents the user with an alert box < 9.5
AngleWidget AngleWidget(msg, horizontal) LM_AngleWidget Creates a new LM_AngleWidget object < 9.5
Button Button(label, msg) LM_Button Creates a new LM_Button object < 9.5
CheckBox CheckBox(label, msg) LM_CheckBox Creates a new LM_CheckBox object < 9.5
ColorSwatch ColorSwatch(allowAlpha, msg) LM_ColorSwatch Creates a new LM_ColorSwatch object < 9.5
Cursor Cursor(path, hotX, hotY) Moho Class Object < 9.5
Divider Divider(vertical) LM_Divider Creates a new LM_Divider object < 9.5
DynamicText DynamicText(label, width) LM_DynamicText Creates a new LM_DynamicText object < 9.5
ImageButton ImageButton(path, tooltip, checkbox, msg, recolor) LM_Button Creates a button with a .png image background < 9.5
ImagePopupMenu ImagePopupMenu(path, radioMode, recolor) LM_PopupMenu Added in version 11.1 11.1
ImageTextList ImageTextList(width, height, msg) LM_ImageTextList Creates a new LM_ImageTextList object 12.2
Menu Menu(title) LM_Menu Creates a new LM_Menu object < 9.5
OpenFile OpenFile(caption) char Prompts the user to select a file to open < 9.5
PopupDialog PopupDialog(label, lockOpen, msg) LM_PopupDialog Creates a new LM_PopupDialog object < 9.5
PopupMenu PopupMenu(width, radioMode) LM_PopupMenu Creates a new LM_PopupMenu object < 9.5
RadioButton RadioButton(label, msg) LM_RadioButton Creates a new LM_RadioButton object < 9.5
SaveFile SaveFile(caption) char Prompts the user to select a file to save < 9.5
ScrollBar ScrollBar(length, vertical, msg, resizingMode) LM_ScrollBar Creates a new LM_ScrollBar object < 9.5
SelectFolder SelectFolder(caption) char Added in version 11 11.0
ShortButton ShortButton(label, msg) LM_ShortButton Creates a new LM_ShortButton object 13.5.2
ShortColorSwatch ShortColorSwatch(allowAlpha, msg) LM_ColorSwatch Added in version 10 10.0
SimpleDialog SimpleDialog(title, subClass) LM_SimpleDialog Creates a new LM_SimpleDialog object < 9.5
Slider Slider(length, vertical, showTicks, msg, resizingMode) LM_Slider Creates a new LM_Slider object < 9.5
StaticText StaticText(label) LM_StaticText Creates a new LM_StaticText object < 9.5
TextControl TextControl(width, text, msg, fieldType, label) LM_TextControl Creates a new LM_TextControl object < 9.5
TextList TextList(width, height, msg) LM_TextList Creates a new LM_TextList object < 9.5

Constants:

Alert boxes

Name Value Description Ver
LM.GUI.ALERT_INFO 0 This type of alert is used to give the user non-critical information. < 9.5
LM.GUI.ALERT_QUESTION 2 This type of alert is used to ask the user a question. < 9.5
LM.GUI.ALERT_WARNING 1 This type of alert is used to warn the user (perhaps that they are about to perform some action that cannot be undone). < 9.5

Control alignment

Name Value Description Ver
LM.GUI.ALIGN_BOTTOM 2 Align control on the bottom side of its container < 9.5
LM.GUI.ALIGN_CENTER 1 Align control in the center of its container < 9.5
LM.GUI.ALIGN_FILL 3 Resize control to fill its container < 9.5
LM.GUI.ALIGN_LEFT 0 Align control on the left side of its container < 9.5
LM.GUI.ALIGN_RIGHT 2 Align control on the right side of its container < 9.5
LM.GUI.ALIGN_TOP 0 Align control on the top side of its container < 9.5

Dialog messages

Name Value Description Ver
LM.GUI.MSG_BASE -40000 The starting message code for use by Moho scripts < 9.5
LM.GUI.MSG_CANCEL -1008 The user clicked Cancel or pressed escape < 9.5
LM.GUI.MSG_OK -1007 The user clicked OK or pressed enter < 9.5

Follow

Name Value Description Ver
LM.GUI.FOLLOW_BOTTOM 8 < 9.5
LM.GUI.FOLLOW_LEFT 1 < 9.5
LM.GUI.FOLLOW_RIGHT 4 < 9.5
LM.GUI.FOLLOW_TOP 2 < 9.5

Key codes

Name Value Description Ver
LM.GUI.KEY_BACKSPACE -4 The Backspace key < 9.5
LM.GUI.KEY_BIND -50 Added in version 11 11.0
LM.GUI.KEY_DELETE -5 The Delete key < 9.5
LM.GUI.KEY_DESELECT -51 Added in version 11 11.0
LM.GUI.KEY_DOWN -13 The down arrow key < 9.5
LM.GUI.KEY_END -7 The End key < 9.5
LM.GUI.KEY_ESCAPE -2 The Escape key < 9.5
LM.GUI.KEY_F1 -20 The F1 key < 9.5
LM.GUI.KEY_F10 -29 The F10 key < 9.5
LM.GUI.KEY_F11 -30 The F11 key < 9.5
LM.GUI.KEY_F12 -31 The F12 key < 9.5
LM.GUI.KEY_F2 -21 The F2 key < 9.5
LM.GUI.KEY_F3 -22 The F3 key < 9.5
LM.GUI.KEY_F4 -23 The F4 key < 9.5
LM.GUI.KEY_F5 -24 The F5 key < 9.5
LM.GUI.KEY_F6 -25 The F6 key < 9.5
LM.GUI.KEY_F7 -26 The F7 key < 9.5
LM.GUI.KEY_F8 -27 The F8 key < 9.5
LM.GUI.KEY_F9 -28 The F9 key < 9.5
LM.GUI.KEY_HOME -6 The Home key < 9.5
LM.GUI.KEY_LEFT -10 The left arrow key < 9.5
LM.GUI.KEY_PAGEDOWN -9 The Page Down key < 9.5
LM.GUI.KEY_PAGEUP -8 The Page Up key < 9.5
LM.GUI.KEY_RETURN -1 The Return or Enter key < 9.5
LM.GUI.KEY_RIGHT -12 The right arrow key < 9.5
LM.GUI.KEY_TAB -3 The Tab key < 9.5
LM.GUI.KEY_UP -11 The up arrow key < 9.5

Layout padding

Name Value Description Ver
LM.GUI.DEFAULT_INDENT 16 The default amount of indentation < 9.5
LM.GUI.DEFAULT_PADDING 8 The default amount of padding < 9.5

Text controls

Name Value Description Ver
LM.GUI.FIELD_FLOAT 2 A text control that only accepts floating-point input < 9.5
LM.GUI.FIELD_INT 1 A text control that only accepts integer input < 9.5
LM.GUI.FIELD_NODIGITS 5 A text control that does not accept any numerical input < 9.5
LM.GUI.FIELD_TEXT 0 A regular text control < 9.5
LM.GUI.FIELD_UFLOAT 4 A text control that only accepts non-negative floating-point input < 9.5
LM.GUI.FIELD_UINT 3 A text control that only accepts non-negative integer input < 9.5

Units

Name Value Description Ver
LM.GUI.UNIT_DEGREES 2 Added in version 14.0 14.0
LM.GUI.UNIT_FPS 3 Added in version 14.0 14.0
LM.GUI.UNIT_FRAMES 5 Added in version 14.0 14.0
LM.GUI.UNIT_MULT 4 Added in version 14.0 14.0
LM.GUI.UNIT_NONE -1 Added in version 14.0 14.0
LM.GUI.UNIT_PERCENT 0 Added in version 14.0 14.0
LM.GUI.UNIT_PIXELS 1 Added in version 14.0 14.0

View mode

Name Value Description Ver
LM.GUI.VIEW_MODE_PIXEL 1 Added in version 10 10.0
LM.GUI.VIEW_MODE_VECTOR 2 Added in version 10 10.0