CorsixTH Lua Documentation

UIResizable Class

Class for resizable windows.

Declared on: line 21 of Lua/dialogs/resizable.lua.
Inheritance: UIResizable ยป Window
Subclasses: UIAdviserHistory, UICallsDispatcher, UICheats, UICustomise, UIDirectoryBrowser, UIDropdown, UIFileBrowser, UIFolder, UIHotkeyAssign, UILuaConsole, UIMachineMenu, UIMainMenu, UIMapEditor, UIMenuList, UINewGame, UIOptions, UIScrollSpeed, UIShiftScrollSpeed, UISoundSettings, UITipOfTheDay, UIUpdate, UIWindowSize, UIZoomSpeed
Full description:
If resizable is set to true, the user can resize by clicking and dragging any of the corners.

Method Index

Member Index

(*) only used in superclass methods
function UIResizable:UIResizable(ui, width, height, colour, no_borders, background_bevel)

Parameters:

NameTypeDescription
ui ? ?
width ? ?
height ? ?
colour ? ?
no_borders ? ?
background_bevel ? ?

Declared on: line 34 of Lua/dialogs/resizable.lua.

function UIResizable:afterLoad(old, new)

Parameters:

NameTypeDescription
old ? ?
new ? ?

Overrides: Window:afterLoad.
Declared on: line 211 of Lua/dialogs/resizable.lua.

function UIResizable:beginResize(x, y, mode)

Initiate resizing of the resizable window.

Parameters:

NameTypeDescription
x ? The X position of the cursor in window coordinates.
y ? The Y position of the cursor in window coordinates.
mode ? Either one of "ul", "ur", "ll" or "lr" to denote in which direction to resize. (upper/lower + left/right)

Declared on: line 170 of Lua/dialogs/resizable.lua.

function UIResizable:draw(canvas, x, y)

Parameters:

NameTypeDescription
canvas ? ?
x ? ?
y ? ?

Overrides: Window:draw.
Declared on: line 97 of Lua/dialogs/resizable.lua.

function UIResizable:hitTest(x, y)

Parameters:

NameTypeDescription
x ? ?
y ? ?

Overrides: Window:hitTest.
Declared on: line 131 of Lua/dialogs/resizable.lua.

function UIResizable:hitTestCorners(x, y)

Tests if any of the four corners of the window border is hit

Parameters:

NameTypeDescription
x ? the x coordinate to test
y ? the y coordinate to test

Declared on: line 149 of Lua/dialogs/resizable.lua.

function UIResizable:onMouseDown(button, x, y)

Parameters:

NameTypeDescription
button ? ?
x ? ?
y ? ?

Overrides: Window:onMouseDown.
Declared on: line 122 of Lua/dialogs/resizable.lua.

function UIResizable:overrideMinSize(min_width, min_height)

Must be called before UIResizable:setSize

Parameters:

NameTypeDescription
min_width int The new minimum width of the window
min_height int The new minimum height of the window

Declared on: line 84 of Lua/dialogs/resizable.lua.

function UIResizable:setColour(colour)

Parameters:

NameTypeDescription
colour ? ?

Declared on: line 92 of Lua/dialogs/resizable.lua.

function UIResizable:setSize(width, height)

Apply the initial width and height of the window

Parameters:

NameTypeDescription
width int The initial width
height int The initial height

Overrides: Window:setSize.
Declared on: line 65 of Lua/dialogs/resizable.lua.