The civ.ui library: Difference between revisions
mNo edit summary |
(Put code tags in the code lines) |
||
Line 6: | Line 6: | ||
[[civ.ui.centerView|centerView]] | [[civ.ui.centerView|centerView]] | ||
civ.ui.centerView(tile) | <code>civ.ui.centerView(tile)</code> | ||
Centers the map on the given tile. | Centers the map on the given tile. | ||
Line 13: | Line 13: | ||
[[civ.ui.redrawMap|redrawMap]] | [[civ.ui.redrawMap|redrawMap]] | ||
civ.ui.redrawMap() | <code>civ.ui.redrawMap()</code> | ||
Redraws the entire map. | Redraws the entire map. | ||
Line 20: | Line 20: | ||
[[civ.ui.redrawTile|redrawTile]] | [[civ.ui.redrawTile|redrawTile]] | ||
civ.ui.redrawTile(tile) | <code>civ.ui.redrawTile(tile)</code> | ||
Redraws the given tile. | Redraws the given tile. | ||
Line 27: | Line 27: | ||
[[civ.ui.setZoom|setZoom]] | [[civ.ui.setZoom|setZoom]] | ||
civ.ui.setZoom(integer) | <code>civ.ui.setZoom(integer)</code> | ||
Sets the zoom level (range from -7 (max zoom out) to 8 (max zoom in)). | Sets the zoom level (range from -7 (max zoom out) to 8 (max zoom in)). | ||
Line 34: | Line 34: | ||
[[civ.ui.text|text]] | [[civ.ui.text|text]] | ||
civ.ui.text(string) | <code>civ.ui.text(string)</code> | ||
Display a pop-up text box with the given string as text. | Display a pop-up text box with the given string as text. | ||
Line 41: | Line 41: | ||
[[civ.ui.zoomIn|zoomIn]] | [[civ.ui.zoomIn|zoomIn]] | ||
civ.ui.zoomIn() | <code>civ.ui.zoomIn()</code> | ||
Zooms in on the map (increases zoom level by 1). | Zooms in on the map (increases zoom level by 1). | ||
Line 48: | Line 48: | ||
[[civ.ui.zoomOut|zoomOut]] | [[civ.ui.zoomOut|zoomOut]] | ||
civ.ui.zoomOut() | <code>civ.ui.zoomOut()</code> | ||
Zooms out of the map (decreases zoom level by 1). | Zooms out of the map (decreases zoom level by 1). | ||
Line 55: | Line 55: | ||
[[civ.ui.loadTerrain|loadTerrain]] | [[civ.ui.loadTerrain|loadTerrain]] | ||
civ.ui.loadTerrain(map, filename1, filename2) | <code>civ.ui.loadTerrain(map, filename1, filename2)</code> | ||
Replaces terrain graphics for map number `map`, loading graphics from `filename1` (corresponding to "TERRAIN1.BMP") and `filename2` (corresponding to "TERRAIN2.BMP") | Replaces terrain graphics for map number `map`, loading graphics from `filename1` (corresponding to "TERRAIN1.BMP") and `filename2` (corresponding to "TERRAIN2.BMP") | ||
Line 62: | Line 62: | ||
[[civ.ui.createDialog|createDialog]] | [[civ.ui.createDialog|createDialog]] | ||
civ.ui.createDialog() -> dialog | <code>civ.ui.createDialog() -> dialog</code> | ||
Creates and initializes a dialog. See the [[The dialog object|dialog]] section for more details. | Creates and initializes a dialog. See the [[The dialog object|dialog]] section for more details. |
Revision as of 22:06, 1 January 2019
Back To TOTPP Functions
civ.ui.centerView(tile)
Centers the map on the given tile.
civ.ui.redrawMap()
Redraws the entire map.
civ.ui.redrawTile(tile)
Redraws the given tile.
civ.ui.setZoom(integer)
Sets the zoom level (range from -7 (max zoom out) to 8 (max zoom in)).
civ.ui.text(string)
Display a pop-up text box with the given string as text.
civ.ui.zoomIn()
Zooms in on the map (increases zoom level by 1).
civ.ui.zoomOut()
Zooms out of the map (decreases zoom level by 1).
civ.ui.loadTerrain(map, filename1, filename2)
Replaces terrain graphics for map number `map`, loading graphics from `filename1` (corresponding to "TERRAIN1.BMP") and `filename2` (corresponding to "TERRAIN2.BMP")
civ.ui.createDialog() -> dialog
Creates and initializes a dialog. See the dialog section for more details.