CorsixTH Lua Documentation

Map Class

Lua extensions to the C++ THMap class

Declared on: line 21 of Lua/map.lua.

Method Index

Member Index

function Map:Map(app)

Parameters:

NameTypeDescription
app ? ?

Declared on: line 28 of Lua/map.lua.

function Map:ScreenToWorld(x, y)

Parameters:

NameTypeDescription
x ? ?
y ? ?

Declared on: line 82 of Lua/map.lua.

function Map:WorldToScreen(x, y)

Convert between world co-ordinates and screen co-ordinates World co-ordinates are (at least for standard maps) in the range [1, 128) for both x and y, with the floor of the values giving the cell index. Screen co-ordinates are pixels relative to the map origin - NOT relative to the top-left corner of the screen (use UI:WorldToScreen and UI:ScreenToWorld for this).

Parameters:

NameTypeDescription
x ? ?
y ? ?

Declared on: line 65 of Lua/map.lua.

function Map:afterLoad(old, new)

Parameters:

NameTypeDescription
old ? ?
new ? ?

Declared on: line 532 of Lua/map.lua.

function Map:afterSave()

Restore the temporarily stored debug information after saving

Declared on: line 290 of Lua/map.lua.

function Map:draw(canvas, sx, sy, sw, sh, dx, dy)

@arguments canvas, screen_x, screen_y, screen_width, screen_height, destination_x, destination_y Draws the rectangle of the map given by (sx, sy, sw, sh) at position (dx, dy) on the canvas --

Parameters:

NameTypeDescription
canvas ? ?
sx ? ?
sy ? ?
sw ? ?
sh ? ?
dx ? ?
dy ? ?

Declared on: line 427 of Lua/map.lua.

function Map:getCellFlag(x, y, flag)

Parameters:

NameTypeDescription
x ? ?
y ? ?
flag ? ?

Declared on: line 41 of Lua/map.lua.

function Map:getParcelPrice(parcel)

Parameters:

NameTypeDescription
parcel ? ?

Declared on: line 521 of Lua/map.lua.

function Map:getParcelTileCount(parcel)

Parameters:

NameTypeDescription
parcel ? ?

Declared on: line 528 of Lua/map.lua.

function Map:getRawData(level_file)

Parameters:

NameTypeDescription
level_file ? ?

Declared on: line 308 of Lua/map.lua.

function Map:getRoomId(x, y)

Parameters:

NameTypeDescription
x ? ?
y ? ?

Declared on: line 45 of Lua/map.lua.

function Map:load(level, difficulty, level_name, level_file, level_intro)

Loads the specified level. If a string is passed it looks for the file with the same name in the "Levels" folder of CorsixTH, if it is a number it tries to load that level from the original game.

Parameters:

NameTypeDescription
level ? The name (or number) of the level to load. If this is a number the game assumes the original game levels are considered.
difficulty ? ?
level_name ? The name of the actual map/area/hospital as written in the config file.
level_file ? The path to the map file as supplied by the config file.
level_intro ? ?

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

function Map:loadDebugText(base_offset, xy_offset, first, last, bits_)

Parameters:

NameTypeDescription
base_offset ? ?
xy_offset ? ?
first ? ?
last ? ?
bits_ ? ?

Declared on: line 343 of Lua/map.lua.

function Map:loadMapConfig(filename, config, custom)

Loads map configurations from files. Returns nil as first result if no configuration could be loaded and config as second result no matter what.

Parameters:

NameTypeDescription
filename ?
config ? If a base config already exists and only some values should be overridden this is the base config
custom ? If true The configuration file is searched for where filename points, otherwise it is assumed that we're looking in the theme_hospital_install path.

Declared on: line 216 of Lua/map.lua.

function Map:prepareForSave()

Keep debug information in temporary local vars, do not save them

Declared on: line 278 of Lua/map.lua.

function Map:setBlocks(blocks)

Parameters:

NameTypeDescription
blocks ? ?

Declared on: line 396 of Lua/map.lua.

function Map:setCellFlags(...)

Parameters:

NameTypeDescription
... ? ?

Declared on: line 401 of Lua/map.lua.

function Map:setDebugFont(font)

Parameters:

NameTypeDescription
font ? ?

Declared on: line 405 of Lua/map.lua.

function Map:setDebugText(x, y, msg, ...)

Parameters:

NameTypeDescription
x ? ?
y ? ?
msg ? ?
... ? ?

Declared on: line 410 of Lua/map.lua.

function Map:setTemperatureDisplayMethod(method)

Parameters:

NameTypeDescription
method ? ?

Declared on: line 49 of Lua/map.lua.

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