drawPitVBL: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(Created page with "{{MacroFunction |name=drawPitVBL |proposed=false |trusted=true |version=1.11.0 |description= Draws Pit Vision Blocking Layer (Pit VBL) shapes. |usage= <source lang="mtmacro"...")
 
m (Minor fixes)
 
(5 intermediate revisions by 3 users not shown)
Line 8: Line 8:


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
drawPitVBL(shapesList)
drawPitVBL(shapeArray)
</source>
</syntaxhighlight>


This function works EXACTLY the same as {{func|erasePitVBL}} with the ONLY difference that drawPitVBL draws the shapes on the Pit Vision Blocking Layer and {{func|erasePitVBL}} erases them.
This function works EXACTLY the same as {{func|erasePitVBL}} with the ONLY difference that drawPitVBL draws the shapes on the Pit Vision Blocking Layer and {{func|erasePitVBL}} erases them.
Line 16: Line 16:


'''Parameters'''
'''Parameters'''
{{param|shapesList|A [[JSON Array]] of [[JSON Object|JSON objects]], one of the latter for each Pit VBL shape. See {{func|drawVBL}} for a complete description of possible shapes}}
{{param|shapeArray|A [[JSON Array]] of [[JSON Object|JSON objects]], one of the latter for each Pit VBL shape. See {{func|drawVBL}} for a complete description of possible shapes}}




|example=
|example=
This example builds an array of the object from the above examples and then feeds that array into the drawPitVBL function
This example builds an array of the object from the above examples and then feeds that array into the drawPitVBL function
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h:rectangle = "{'shape':'rectangle','x':50,'y':50,'w':100,'h':200,'r':45,'fill':1,'thickness':1,'scale':0}"]
[h:rectangle = "{'shape':'rectangle','x':50,'y':50,'w':100,'h':200,'r':45,'fill':1,'thickness':1,'scale':0}"]
[h:cross = "{'shape':'cross','x':-50,'y':-50,'w':50,'h':100,'r':30,'fill':1,'thickness':1,'scale':2}"]
[h:cross = "{'shape':'cross','x':-50,'y':-50,'w':50,'h':100,'r':30,'fill':1,'thickness':1,'scale':2}"]
Line 28: Line 28:
[h:objectArrary = json.append('',rectangle, cross, circle, polygon)]
[h:objectArrary = json.append('',rectangle, cross, circle, polygon)]
[h:drawPitVBL(objectArrary)]
[h:drawPitVBL(objectArrary)]
</source>
</syntaxhighlight>
results in:<br/>
results in:<br/>
TODO
[[Image:drawPitVBL.png]]




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

Latest revision as of 03:56, 5 June 2023

drawPitVBL() Function

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

Introduced in version 1.11.0
Draws Pit Vision Blocking Layer (Pit VBL) shapes.

Usage

drawPitVBL(shapeArray)

This function works EXACTLY the same as erasePitVBL() with the ONLY difference that drawPitVBL draws the shapes on the Pit Vision Blocking Layer and erasePitVBL() erases them.


Parameters

Example

This example builds an array of the object from the above examples and then feeds that array into the drawPitVBL function
[h:rectangle	= "{'shape':'rectangle','x':50,'y':50,'w':100,'h':200,'r':45,'fill':1,'thickness':1,'scale':0}"]
[h:cross	= "{'shape':'cross','x':-50,'y':-50,'w':50,'h':100,'r':30,'fill':1,'thickness':1,'scale':2}"]
[h:circle	= "{'shape':'circle', 'x':50, 'y':100, 'radius':200, 'thickness':3, 'fill':0, 'sides':12,'r':45}"]
[h:polygon	= "{'shape':'polygon','r':0,'close':1,'thickness':10,'points':[{'x':0,'y':0},{'x':200,'y':200},{'x':150,'y':10}]}"] 
[h:objectArrary	= json.append('',rectangle, cross, circle, polygon)]
[h:drawPitVBL(objectArrary)]

results in:

See Also