CorsixTH Lua Documentation

GameUI Class

Variant of UI for running games

Declared on: line 23 of Lua/game_ui.lua.
Inheritance: GameUI » UI » Window

Method Index

Member Index

(*) only used in superclass methods
function GameUI:GameUI(app, local_hospital)

Parameters:

NameTypeDescription
app ? ?
local_hospital ? ?

Declared on: line 32 of Lua/game_ui.lua.

function GameUI:ScreenToWorld(x, y)

Parameters:

NameTypeDescription
x ? ?
y ? ?

Declared on: line 275 of Lua/game_ui.lua.

function GameUI:WorldToScreen(x, y)

Parameters:

NameTypeDescription
x ? ?
y ? ?

Declared on: line 280 of Lua/game_ui.lua.

function GameUI:afterLoad(old, new)

Parameters:

NameTypeDescription
old ? ?
new ? ?

Overrides: UI:afterLoad.
Declared on: line 958 of Lua/game_ui.lua.

function GameUI:applyTransparency()

Applies the current setting for wall transparency to the map

Declared on: line 692 of Lua/game_ui.lua.

function GameUI:draw(canvas)

Parameters:

NameTypeDescription
canvas ? ?

Overrides: UI:draw.
Declared on: line 134 of Lua/game_ui.lua.

function GameUI:limitCamera(mode)

Parameters:

NameTypeDescription
mode ? ?

Declared on: line 687 of Lua/game_ui.lua.

function GameUI.limitPointToDiamond(dx, dy, visible_diamond, do_limit)

Parameters:

NameTypeDescription
dx ? ?
dy ? ?
visible_diamond ? ?
do_limit ? ?

Declared on: line 626 of Lua/game_ui.lua.
Note: Is a function rather than a method.

function GameUI:makeTransparentWalls()

Toggles transparency of walls, i.e. enables if currently disabled, and vice versa

Declared on: line 704 of Lua/game_ui.lua.

function GameUI:makeVisibleDiamond(scr_w, scr_h)

Parameters:

NameTypeDescription
scr_w ? ?
scr_h ? ?

Declared on: line 93 of Lua/game_ui.lua.

function GameUI:onKeyDown(code, rawchar)

Parameters:

NameTypeDescription
code ? ?
rawchar ? ?

Overrides: UI:onKeyDown.
Declared on: line 234 of Lua/game_ui.lua.

function GameUI:onKeyUp(code)

Parameters:

NameTypeDescription
code ? ?

Overrides: UI:onKeyUp.
Declared on: line 247 of Lua/game_ui.lua.

function GameUI:onMouseMove(x, y, dx, dy)

TODO: try to remove duplication with UI:onMouseMove

Parameters:

NameTypeDescription
x ? ?
y ? ?
dx ? ?
dy ? ?

Overrides: UI:onMouseMove.
Declared on: line 396 of Lua/game_ui.lua.

function GameUI:onMouseUp(code, x, y)

Parameters:

NameTypeDescription
code ? ?
x ? ?
y ? ?

Overrides: UI:onMouseUp.
Declared on: line 484 of Lua/game_ui.lua.

function GameUI:onWindowActive(gain)

Called when the mouse enters or leaves the game window.

Parameters:

NameTypeDescription
gain ? ?

Overrides: UI:onWindowActive.
Declared on: line 389 of Lua/game_ui.lua.

function GameUI:playAnnouncement(name)

Parameters:

NameTypeDescription
name ? ?

Overrides: UI:playAnnouncement.
Declared on: line 539 of Lua/game_ui.lua.

function GameUI:quit()

Offers a confirmation window to quit the game and return to main menu NB: overrides UI.quit, do NOT call it from here

Overrides: UI:quit.
Declared on: line 1005 of Lua/game_ui.lua.

function GameUI:resync(ui)

Update UI state after the UI has been depersisted

When an UI object is depersisted, its state will reflect how the UI was at the moment of persistence, which may be different to the keyboard / mouse state at the moment of depersistence.

Parameters:

NameTypeDescription
ui UI The previously existing UI object, from which values should be taken.

Declared on: line 165 of Lua/game_ui.lua.

function GameUI:scrollMap(dx, dy)

Parameters:

NameTypeDescription
dx ? ?
dy ? ?

Declared on: line 676 of Lua/game_ui.lua.

function GameUI:scrollMapTo(x, y)

Parameters:

NameTypeDescription
x ? ?
y ? ?

Declared on: line 619 of Lua/game_ui.lua.

function GameUI:setEditRoom(enabled)

Parameters:

NameTypeDescription
enabled ? ?

Declared on: line 931 of Lua/game_ui.lua.

function GameUI:setWallsTransparent(mode)

Sets wall transparency to the specified parameter

Parameters:

NameTypeDescription
mode boolean whether to enable or disable wall transparency

Declared on: line 697 of Lua/game_ui.lua.

function GameUI:setWorldHitTest(mode)

Change if the World should be tested for entities under the cursor

to disable, room to enable only for non-door objects in given room

Parameters:

NameTypeDescription
mode boolean or or or room true to enable hit test (normal), false

Declared on: line 292 of Lua/game_ui.lua.

function GameUI:setZoom(factor)

Parameters:

NameTypeDescription
factor ? ?

Declared on: line 109 of Lua/game_ui.lua.

function GameUI:startTutorial(chapter)

Parameters:

NameTypeDescription
chapter ? ?

Declared on: line 923 of Lua/game_ui.lua.

function GameUI:tutorialStep(chapter, phase_from, phase_to, ...)

Called to trigger step to another part of the tutorial. chapter: Individual parts of the tutorial. Step will only happen if it's the current chapter. phase_from: Phase we need to be in for this step to happen. Multiple phases can be given here in an array. phase_to: Phase we want to step to or "next" to go to next chapter or "end" to end tutorial. returns true if we changed phase, false if we didn't

Parameters:

NameTypeDescription
chapter ? ?
phase_from ? ?
phase_to ? ?
... ? ?

Overrides: UI:tutorialStep.
Declared on: line 865 of Lua/game_ui.lua.

Page generated on Sat Feb 07, 2015 at 18:38:28 by LDocGen.