3.02 GUI variables
Updated on every loop with the mouse coordinates, relative to the script window. Identical to
gfx.mouse_x, gfx.mouse_y
.
Updated on every loop with the state of Ctrl, Shift, Alt, etc. Identical to gfx.mouse_cap
.
1 Left mouse button
2 Right mouse button
4 Control key
8 Shift key
16 Alt key
32 Windows key
64 Middle mouse button
Values can be checked using bitwise comparison:
if GUI.mouse.cap & 8 == 8 then shift_is_pressed end
.
Updated on every loop with the position (relative to the last value) of the mouse wheel. Shouldn't
need to be accessed directly; all GUI elements receive a value, inc
, when :onwheel
is
called. Identical to gfx.mouse_wheel
.
While a mouse button is down, these store the element that was clicked.
Also: rmouse_down_elm, mmouse_down_elm
.
When the mouse is being dragged (i.e. an element's :ondrag logic is being called), these store the the mouse's original coordinates in the script window.
Also: r_ox, r_oy, m_ox, m_oy
.
When the mouse is being dragged these store the mouse's original position relative to the element
being dragged. i.e. If the element was at 32,32
, and the mouse was pressed down at
64,48
, off_x and off_y would be 32,16
.
Also: r_off_x, r_off_y, m_off_x, m_off_y
.
Updated on every loop with the keyboard state. Identical to calling gfx.getchar()
.
Boolean. When set to true
, pressing Esc will not close the script window. Use this if your
script needs to use Esc for something itself.
Boolean. True
if the SWS extension is available (currently only SWS v2.9.7 or newer).
Boolean. True
if the script is running in "restricted permissions" mode.
Number. Specifies the delay time when the mouse is hovered over an element before a tooltip is shown (if GUI.elms.my_elm.tooltip = "Hello!"
is specified).
Introduction
- 1. Getting started
- 2. Parts of a basic script
- 3. How it works
- 4. Fonts and colors
- 5. Element methods
Elements
- 1. Button
- 2. Frame
- 3. Knob
- 4. Label
- 5. Listbox
- 6. Menubar
- 7. Menubox
- 8. Options
- 9. Slider
- 10. Tabs
- 11. Textbox
- 12. TextEditor
- 13. Window
Core functions
- 1. Element creation
- 2. GUI variables
- 3. Script hooks
- 4. Table functions
- 5. Text functions
- 6. Color functions
- 7. Math and Logic functions
- 8. Graphics functions
- 9. Element functions
Additional documentation