GameUI Class
Variant of UI for running games
Method Index
- ScreenToWorld(x, y)
- WorldToScreen(x, y)
- _translateKeyCode(code, rawchar) (inherited from UI)
- addBevelPanel(x, y, w, h, colour, highlight_colour, shadow_colour, disabled_colour) (inherited from Window)
- addColourPanel(x, y, w, h, r, g, b) (inherited from Window)
- addKeyHandler(keys, window, callback, ...) (inherited from UI)
- addPanel(sprite_index, x, y, w, h) (inherited from Window)
- addWindow(window) (inherited from UI)
- afterLoad(old, new) (overrides UI:afterLoad)
- applyTransparency()
- beginDrag(x, y) (inherited from Window)
- bringToTop() (inherited from Window)
- changeResolution(width, height) (inherited from UI)
- close() (inherited from Window)
- closeWindow() (inherited from UI)
- disableKeyboardRepeat() (inherited from UI)
- draw(canvas) (overrides UI:draw)
- drawTooltip(canvas) (inherited from UI)
- enableKeyboardRepeat(delay, interval) (inherited from UI)
- exitApplication() (inherited from UI)
- getCursorPosition(window) (inherited from UI)
- getSavedWindowPositionName() (inherited from Window)
- getScreenOffset() (overrides UI:getScreenOffset)
- getTooltipAt(x, y) (inherited from Window)
- getTooltipForElement(elem, x, y) (inherited from Window)
- getWindow(window_class) (inherited from Window)
- getWindows(window_class) (inherited from Window)
- hitTest(x, y) (inherited from Window)
- hitTestPanel(x, y, panel) (inherited from Window)
- initKeyAndButtonCodes() (inherited from UI)
- keySpeedUp()
- keyTransparent()
- limitCamera(mode)
- limitPointToDiamond(dx, dy, visible_diamond, do_limit)
- makeButtonOnPanel(panel, x, y, w, h, sprite, on_click, on_click_self, on_rightclick) (inherited from Window)
- makeDebugFax()
- makeDynamicTooltip(callback, x, y, r, b, tooltip_x, tooltip_y) (inherited from Window)
- makeScreenshot() (inherited from UI)
- makeScrollbarOnPanel(panel, slider_colour, callback, min_value, max_value, page_size, value) (inherited from Window)
- makeTextboxOnPanel(panel, confirm_callback, abort_callback) (inherited from Window)
- makeTooltip(text, x, y, r, b, tooltip_x, tooltip_y) (inherited from Window)
- makeTransparentWalls()
- makeVisibleDiamond(scr_w, scr_h)
- onChangeLanguage() (inherited from Window)
- onChangeResolution() (overrides UI:onChangeResolution)
- onCursorWorldPositionChange() (overrides Window:onCursorWorldPositionChange)
- onKeyDown(code, rawchar) (overrides UI:onKeyDown)
- onKeyUp(code) (overrides UI:onKeyUp)
- onMouseDown(code, x, y) (inherited from UI)
- onMouseMove(x, y, dx, dy) (overrides UI:onMouseMove)
- onMouseUp(code, x, y) (overrides UI:onMouseUp)
- onTick() (overrides UI:onTick)
- onWindowActive(gain) (overrides UI:onWindowActive)
- onWorldTick() (inherited from Window)
- playAnnouncement(name) (overrides UI:playAnnouncement)
- playSound(name) (inherited from UI)
- quit() (overrides UI:quit)
- registerTextBox(box) (inherited from UI)
- removeAllPanels() (inherited from Window)
- removeKeyHandler(keys, window) (inherited from UI)
- removeTransparentWalls()
- removeWindow(window) (inherited from UI)
- resetApp() (inherited from UI)
- resetVideo() (inherited from UI)
- resync(ui)
- scrollMap(dx, dy)
- scrollMapTo(x, y)
- sendToBottom(window) (inherited from Window)
- sendToTop(window) (inherited from Window)
- setCursor(cursor) (inherited from UI)
- setDefaultCursor(cursor) (inherited from UI)
- setDefaultPosition(x, y) (inherited from Window)
- setEditRoom(enabled)
- setMenuBackground() (inherited from UI)
- setPosition(x, y) (inherited from Window)
- setRandomAnnouncementTarget()
- setWallsTransparent(mode)
- setWorldHitTest(mode)
- setZoom(factor)
- setupGlobalKeyHandlers() (overrides UI:setupGlobalKeyHandlers)
- showBriefing()
- showCheatsWindow()
- showLuaConsole() (inherited from UI)
- showMenuBar()
- startButtonBlinking(button_index) (inherited from Window)
- startTutorial(chapter)
- stopButtonBlinking() (inherited from Window)
- stopMovie() (inherited from UI)
- stopVideo() (inherited from UI)
- toggleAdviser() (inherited from UI)
- toggleFullscreen() (inherited from UI)
- togglePlayAnnouncements() (inherited from UI)
- togglePlayMusic(item) (inherited from UI)
- togglePlaySounds() (inherited from UI)
- tutorialStep(chapter, phase_from, phase_to, ...) (overrides UI:tutorialStep)
- unregisterTextBox(box) (inherited from UI)
- updateKeyScroll()
- updateTooltip() (inherited from UI)
Member Index
- active_button (*)
- active_scrollbar (*)
- adviser
- app
- background (*)
- background_height (*)
- background_width (*)
- blink_counter (*)
- blinking_button (*)
- bottom_panel
- btn_repeat_delay (*)
- button_codes
- buttons (*)
- buttons_down
- closed (*)
- current_momentum
- cursor
- cursor_entity
- cursor_room
- cursor_x
- cursor_y
- debug_cursor_entity
- default_button_sound (*)
- default_cursor
- do_world_hit_test
- down_count
- down_cursor
- drag_mouse_move
- draggable (*)
- dragging (*)
- edit_room
- edit_room_cursor
- editing_allowed (*)
- grab_cursor (*)
- height (*)
- hospital
- in_visible_diamond
- key_code_to_rawchar
- key_codes
- key_handlers (*)
- key_remaps
- key_to_button_remaps
- keyboard_repeat_enable_count (*)
- limit_to_visible_diamond
- menu_bar
- modal_windows (*)
- momentum
- panel_sprites (*)
- panels (*)
- parent (*)
- random_announcement_ticks_target
- screen_offset_x
- screen_offset_y
- scrollbars (*)
- simulated_cursor
- textboxes (*)
- tick_scroll_amount
- tick_scroll_amount_mouse
- tick_scroll_mult
- ticks_since_last_announcement
- toggleWallsTransparent
- tooltip (*)
- tooltip_counter (*)
- tooltip_font (*)
- tooltip_regions (*)
- transparent_walls
- tutorial
- ui (*)
- visible (*)
- visible_diamond
- waiting_cursor
- width (*)
- windows
- x (*)
- x_original (*)
- y (*)
- y_original (*)
- zoom_factor
function GameUI:GameUI(app, local_hospital)
Parameters:
Name | Type | Description |
---|---|---|
app | ? | ? |
local_hospital | ? | ? |
Declared on: line 32 of Lua/game_ui.lua.
function GameUI:ScreenToWorld(x, y)
Parameters:
Name | Type | Description |
---|---|---|
x | ? | ? |
y | ? | ? |
Declared on: line 275 of Lua/game_ui.lua.
function GameUI:WorldToScreen(x, y)
Parameters:
Name | Type | Description |
---|---|---|
x | ? | ? |
y | ? | ? |
Declared on: line 280 of Lua/game_ui.lua.
function GameUI:afterLoad(old, new)
Parameters:
Name | Type | Description |
---|---|---|
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:
Name | Type | Description |
---|---|---|
canvas | ? | ? |
Overrides: UI:draw.
Declared on: line 134 of Lua/game_ui.lua.
function GameUI:getScreenOffset()
Overrides: UI:getScreenOffset.
Declared on: line 288 of Lua/game_ui.lua.
function GameUI:keySpeedUp()
Declared on: line 222 of Lua/game_ui.lua.
function GameUI:keyTransparent()
Declared on: line 228 of Lua/game_ui.lua.
function GameUI:limitCamera(mode)
Parameters:
Name | Type | Description |
---|---|---|
mode | ? | ? |
Declared on: line 687 of Lua/game_ui.lua.
function GameUI.limitPointToDiamond(dx, dy, visible_diamond, do_limit)
Parameters:
Name | Type | Description |
---|---|---|
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:makeDebugFax()
Declared on: line 265 of Lua/game_ui.lua.
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:
Name | Type | Description |
---|---|---|
scr_w | ? | ? |
scr_h | ? | ? |
Declared on: line 93 of Lua/game_ui.lua.
function GameUI:onChangeResolution()
Overrides: UI:onChangeResolution.
Declared on: line 155 of Lua/game_ui.lua.
function GameUI:onCursorWorldPositionChange()
Overrides: Window:onCursorWorldPositionChange.
Declared on: line 299 of Lua/game_ui.lua.
function GameUI:onKeyDown(code, rawchar)
Parameters:
Name | Type | Description |
---|---|---|
code | ? | ? |
rawchar | ? | ? |
Overrides: UI:onKeyDown.
Declared on: line 234 of Lua/game_ui.lua.
function GameUI:onKeyUp(code)
Parameters:
Name | Type | Description |
---|---|---|
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:
Name | Type | Description |
---|---|---|
x | ? | ? |
y | ? | ? |
dx | ? | ? |
dy | ? | ? |
Overrides: UI:onMouseMove.
Declared on: line 396 of Lua/game_ui.lua.
function GameUI:onMouseUp(code, x, y)
Parameters:
Name | Type | Description |
---|---|---|
code | ? | ? |
x | ? | ? |
y | ? | ? |
Overrides: UI:onMouseUp.
Declared on: line 484 of Lua/game_ui.lua.
function GameUI:onTick()
Overrides: UI:onTick.
Declared on: line 546 of Lua/game_ui.lua.
function GameUI:onWindowActive(gain)
Called when the mouse enters or leaves the game window.
Parameters:
Name | Type | Description |
---|---|---|
gain | ? | ? |
Overrides: UI:onWindowActive.
Declared on: line 389 of Lua/game_ui.lua.
function GameUI:playAnnouncement(name)
Parameters:
Name | Type | Description |
---|---|---|
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:
Name | Type | Description |
---|---|---|
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:
Name | Type | Description |
---|---|---|
dx | ? | ? |
dy | ? | ? |
Declared on: line 676 of Lua/game_ui.lua.
function GameUI:scrollMapTo(x, y)
Parameters:
Name | Type | Description |
---|---|---|
x | ? | ? |
y | ? | ? |
Declared on: line 619 of Lua/game_ui.lua.
function GameUI:setEditRoom(enabled)
Parameters:
Name | Type | Description |
---|---|---|
enabled | ? | ? |
Declared on: line 931 of Lua/game_ui.lua.
function GameUI:setWallsTransparent(mode)
Sets wall transparency to the specified parameter
Parameters:
Name | Type | Description |
---|---|---|
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:
Name | Type | Description |
---|---|---|
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:
Name | Type | Description |
---|---|---|
factor | ? | ? |
Declared on: line 109 of Lua/game_ui.lua.
function GameUI:setupGlobalKeyHandlers()
Overrides: UI:setupGlobalKeyHandlers.
Declared on: line 74 of Lua/game_ui.lua.
function GameUI:showBriefing()
Declared on: line 994 of Lua/game_ui.lua.
function GameUI:showMenuBar()
Declared on: line 1017 of Lua/game_ui.lua.
function GameUI:startTutorial(chapter)
Parameters:
Name | Type | Description |
---|---|---|
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:
Name | Type | Description |
---|---|---|
chapter | ? | ? |
phase_from | ? | ? |
phase_to | ? | ? |
... | ? | ? |
Overrides: UI:tutorialStep.
Declared on: line 865 of Lua/game_ui.lua.
function GameUI:updateKeyScroll()
Declared on: line 205 of Lua/game_ui.lua.