findDrawings: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{MacroFunction |name=findDrawings |version=1.4.1.9 |trusted=true |description= Returns the id or ids of any drawing on the specified map that match the name parameter. |usage...") |
m (Conversion script moved page FindDrawings to findDrawings: Converting page titles to lowercase) |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{MacroFunction | {{MacroFunction | ||
|name=findDrawings | |name=findDrawings | ||
|version=1. | |version=1.5.0 | ||
|trusted=true | |trusted=true | ||
|description= | |description= | ||
Returns the id or ids of any drawing on the specified map that | Returns the id or ids of any drawing on the specified map that matches the name parameter. | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
findDrawings( | findDrawings(mapRef, name) | ||
findDrawings( | findDrawings(mapRef, name, delim) | ||
</ | </syntaxhighlight > | ||
'''Parameters''' | '''Parameters''' | ||
{{param| | {{param|mapRef|The Name or ID of the map.}} | ||
{{param|name|A string containing name of the searched for drawings. | {{param|name|A string containing name of the searched for drawings. Pass {{code|"*"}} to get all drawings. Drawings can be named via the Draw Explorer interface or using {{func|setDrawingName}}.}} | ||
{{param|delim|Optional separator. If not specified the default value {{code|","}} is used. }} | {{param|delim|Optional separator. If not specified, the default value {{code|","}} is used. If {{code|"json"}} is specified, a JSON array is returned instead of a String List.}} | ||
|example= | |example= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[h:id=findDrawings("Grasslands", "block")] | [h:id=findDrawings("Grasslands", "block")] | ||
[h:setFillColor("Grasslands", id," | [h:setFillColor("Grasslands", id,"#000000")] | ||
[h:refreshDrawing("Grasslands", id)] | [h:refreshDrawing("Grasslands", id)] | ||
</ | </syntaxhighlight > | ||
|also= | |also= | ||
{{func|setFillColor}} {{func|refreshDrawing}} | {{func|setFillColor}} {{func|refreshDrawing}} {{func|setDrawingName}} | ||
|changes= | |||
* '''1.10.0''' - Added wildcard option for drawing name. | |||
}} | }} | ||
[[Category:Draw Function]] | [[Category:Draw Function]] |
Latest revision as of 23:59, 9 February 2023
findDrawings() Function
Note: This function can only be used in a Trusted Macro
• Introduced in version 1.5.0
Returns the id or ids of any drawing on the specified map that matches the name parameter.
Usage
findDrawings(mapRef, name)
findDrawings(mapRef, name, delim)
Parameters
mapRef
- The Name or ID of the map.name
- A string containing name of the searched for drawings. Pass"*"
to get all drawings. Drawings can be named via the Draw Explorer interface or using setDrawingName().delim
- Optional separator. If not specified, the default value","
is used. If"json"
is specified, a JSON array is returned instead of a String List.
Example
[h:id=findDrawings("Grasslands", "block")]
[h:setFillColor("Grasslands", id,"#000000")]
[h:refreshDrawing("Grasslands", id)]
See Also
Version Changes
- 1.10.0 - Added wildcard option for drawing name.