createMap: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{MacroFunction |name=createMap |trusted=false |version=1.14.0 |description= Creates a map from the information in the required JSON object parameter. The JSON object must have {{code|name}}, and has optional {{code|config}} key/value pairs. |usage= <syntaxhighlight lang="mtmacro" line> createMap(name) createMap(name,config) </syntaxhighlight> '''Parameters''' {{param|name|A string with the name of the new map.}} {{param|name|A JSON object as described for the {{code|co...") |
No edit summary |
||
Line 46: | Line 46: | ||
The ID of the created Map. | The ID of the created Map. | ||
Create a map called {{code|New Map}} with . | Create a map called {{code|New Map}} with {{param|config}} options set. | ||
Revision as of 06:27, 11 December 2023
createMap() Function
• Introduced in version 1.14.0
Creates a map from the information in the required JSON object parameter. The JSON object must have
name
, and has optional config
key/value pairs.Usage
createMap(name)
createMap(name,config)
Parameters
name
- A string with the name of the new map.name
- A JSON object as described for theconfig options
parameter of copyMap().
config parameter
config is a JSON Object that can contain any of the following fields. Field names are case-sensitive, and all fields are optional:
display name:
- defaults to noneplayer visible:
- defaults to user preferencesvision type:
- defaults to user preferencesvision distance:
- defaults to user preferenceslighting style:
- defaults to "OVERTOP"background paint:
- defaults to built-in Grassfog paint:
- defaults to blackhas fog:
- defaults to user preferences (TODO Implement it)map asset:
- defaults to nonegrid:
- JSON object, see below
The grid value is another JSON object, with these optional keys:
type:
- defaults to user preferencescolor:
- defaults to user preferencesunits per cell:
- defaults to user preferencessize:
- defaults to user preferencesx offset:
- defaults to 0y offset:
- defaults to 0
Examples
Create a map called
New Map
.
[h: id = createMap("New Map)]
Returns: The ID of the created Map.
Create a map called New Map
with
config
- {{{2}}} options set.
See Also
Version Changes
- 1.11.0 - First released.