setDrawingOpacity: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(2 intermediate revisions by one other user not shown)
Line 6: Line 6:
Sets the transparency value of a specified drawing.
Sets the transparency value of a specified drawing.
|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
setDrawingOpacity(mapName, drawingId, opacity)
setDrawingOpacity(mapName, drawingId, opacity)
</source>
</syntaxhighlight>
'''Parameters'''
'''Parameters'''
{{param|mapName|A string containing the name of the map.}}
{{param|mapName|A string containing the name of the map.}}
Line 14: Line 14:
{{param|opacity|A number between 1 and 0 representing the transparency of the drawing.}}
{{param|opacity|A number between 1 and 0 representing the transparency of the drawing.}}
|examples=
|examples=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h:setDrawingOpacity("Grasslands", "0000000094218C675800000000000000",0.5)]
[h:setDrawingOpacity("Grasslands", "0000000094218C675800000000000000",0.5)]
[h:refreshDrawing("Grasslands", "0000000094218C675800000000000000")]
[h:refreshDrawing("Grasslands", "0000000094218C675800000000000000")]
</source>
</syntaxhighlight>
|also=
|also=
{{func|getDrawingOpacity}} {{func|refreshDrawing}}
{{func|getDrawingOpacity}} {{func|refreshDrawing}}
}}
}}
[[Category:Draw Function]]
[[Category:Draw Function]]

Latest revision as of 21:04, 14 March 2023

setDrawingOpacity() Function

 Note: This function can only be used in a Trusted Macro

Introduced in version 1.5.0
Sets the transparency value of a specified drawing.

Usage

setDrawingOpacity(mapName, drawingId, opacity)

Parameters

  • mapName - A string containing the name of the map.
  • drawingId - A string containing the id of the drawing. The easiest way to discover a drawing's Id is via the Draw Explorer interface.
  • opacity - A number between 1 and 0 representing the transparency of the drawing.

Examples

[h:setDrawingOpacity("Grasslands", "0000000094218C675800000000000000",0.5)]
[h:refreshDrawing("Grasslands", "0000000094218C675800000000000000")]

See Also