eraseVBL: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 5: Line 5:
|version=1.3b89
|version=1.3b89
|description=
|description=
Erases Vision Blocking Layer (VBL) shapes.
Erases Vision Blocking Layer (VBL) shapes from the '''Map''' VBL.  This function does not affect Token VBL.
<p>
This function works the same as {{func|drawVBL}} with the difference that {{func|drawVBL}} draws the shapes on the Vision Blocking Layer and {{func|eraseVBL}} erases them. For more examples go to the {{func|drawVBL}} page.  


|usage=
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
eraseVBL(shapesList)
eraseVBL(shapeArray)
</source>
</source>
 
'''Parameters'''
This function works EXACTLY the same as {{func|drawVBL}} with the ONLY difference that {{func|drawVBL}} draws the shapes on the vision blocking layer and eraseVBL erases them. For descriptions on parameters and more examples goto the {{func|drawVBL}} page.
{{param|shapeArray|An array of one or more shapes as JSON objects.}}


|example=
|example=
This example erases a (solid) block of VBL of 200x200 pixels, centered on the origin of the map
This example erases a (solid) block of VBL of 200x200 pixels starting at the origin of the map
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h:rectangle = "{'shape':'rectangle','x':0,'y':0,'w':200,'h':200, 'fill':1}"]
[h:rectangle = "{'shape':'rectangle','x':0,'y':0,'w':200,'h':200, 'fill':1}"]

Revision as of 19:14, 28 April 2020

eraseVBL() Function

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

Introduced in version 1.3b89
Erases Vision Blocking Layer (VBL) shapes from the Map VBL. This function does not affect Token VBL.

This function works the same as drawVBL() with the difference that drawVBL() draws the shapes on the Vision Blocking Layer and eraseVBL() erases them. For more examples go to the drawVBL() page.

Usage

eraseVBL(shapeArray)

Parameters

  • shapeArray - An array of one or more shapes as JSON objects.

Example

This example erases a (solid) block of VBL of 200x200 pixels starting at the origin of the map
[h:rectangle	= "{'shape':'rectangle','x':0,'y':0,'w':200,'h':200, 'fill':1}"]
[h:objectArrary	= json.append('',rectangle)]
[h:eraseVBL(objectArrary)]

See Also