eraseVBL: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(Modified usage, added link)
m (Conversion script moved page EraseVBL to eraseVBL: Converting page titles to lowercase)
 
(11 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{stub|Needs a proper description.<br />
Parameters need to be defined.<br />
Lacks examples.}}
{{MacroFunction
{{MacroFunction
|name=eraseVBL
|name=eraseVBL
Line 8: Line 5:
|version=1.3b89
|version=1.3b89
|description=
|description=
This function erases a VBL shape from the supplied coordinates.
Erases Wall Vision Blocking Layer (Wall 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>
<syntaxhighlight lang="mtmacro" line>
eraseVBL(???)
eraseVBL(shapeArray)
</source>
</syntaxhighlight>
'''Parameters'''
{{param|shapeArray|An array of one or more shapes as JSON objects.}}


'''Parameters'''
{{note|Consist of [[JSON Object|JSON objects]] nested in a [[JSON Array]]. The objects' keys seem to be "shape" ''("polygon", "rectangle", "circle", "cross")'', "r" ''(???)'', "fill" ''(boolean)'', "close" ''(???)'', "thickness" ''(pixels)'', "points" ''(object)'', "x" ''(pixels)'', "y" ''(pixels)'', "w" ''(pixels)'', "h" ''(pixels)'', "scale" ''(???)'', "radius" ''(pixels)'', "sides" ''(integer)'', "facing" ''(degrees from ??? rotating ???)'', "rx" ''(pixels)'', "ry" ''(pixels)''.}}
|example=
|example=
This example doesn't really do anything.
This example erases a (solid) block of VBL of 200x200 pixels starting at the origin of the map
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: exampleVariable = "a,b,c"]
[h:rectangle = "{'shape':'rectangle','x':0,'y':0,'w':200,'h':200, 'fill':1}"]
[r: exampleFunction(exampleVariable, reverse)]
[h:objectArrary = json.append('',rectangle)]
</source>
[h:eraseVBL(objectArrary)]
Returns:
</syntaxhighlight>
<source lang="mtmacro" line>
[[Category:VBL Function]]
c,b,a
</source>


|also=
|also=
[[Introduction to Vision Blocking]], {{func|drawVBL}}
[[Introduction to Vision Blocking]], {{func|drawVBL}}
}}
}}
[[Category:Token Function]]
[[Category:Miscellaneous Function]]

Latest revision as of 23:31, 9 February 2023

eraseVBL() Function

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

Introduced in version 1.3b89
Erases Wall Vision Blocking Layer (Wall 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