getVBL: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(New page: {{MacroFunction |name=getVBL |proposed=false |trusted=true |version=1.3b90 |description= This function saves Vision Blocking Layer (VBL) shapes. |usage= <source lang="mtmacro" line> drawV...)
 
m (Text replacement - "source>" to "syntaxhighlight>")
 
(10 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{stub}}
{{MacroFunction
{{MacroFunction
|name=getVBL
|name=getVBL
Line 5: Line 6:
|version=1.3b90
|version=1.3b90
|description=
|description=
This function saves Vision Blocking Layer (VBL) shapes.
Gets the Wall Vision Blocking Layer (Wall VBL) shapes for the area specified in the {{code|shape}} parameter.


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
drawVBL(shape,format)
getVBL(shape)
</source>
getVBL(shape,format)
 
</syntaxhighlight>
This function retrieves the found shape in the given shape.


This function retrieves the Wall VBL found in the given shape(s).


'''Parameters'''
'''Parameters'''
{{param|shape|A json object as described in {{func|drawVBL}}.}}
{{param|shape|A JSON object, or an array of JSON objects, as described in {{func|drawVBL}}. If an array, gets all the Wall VBL within all provided shapes, otherwise just the Wall VBL in the single provided shape.}}
{{param|format|Boolean. 0 returns a json object similar to the one you feed it. 1 returns an array of coordinates which covers the VBL found in the area}}
{{param|format|OPTIONAL Boolean. Returns a JSON object if {{false}}, or a JSON array of coordinates if {{true}}.  In either case, the returned shape covers the Wall VBL found in the area. Defaults to {{false}}}}




''Example:''<source lang="mtmacro">
|examples=
[h:rectangle = "{'shape':'rectangle','x':50,'y':50,'w':100,'h':200,'r':45,'fill':1,'thickness':1,'scale':0}"]
<syntaxhighlight lang="mtmacro">
[r:vblData  = getVBL(h:rectangle , 0)]
[h:rectangle = '{"shape":"rectangle","x":50,"y":50,"w":100,"h":200,"r":45,"fill":1,"thickness":1,"scale":0}']
</source><br />
[r:vblData  = getVBL(rectangle , 0)]
</syntaxhighlight><br />


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

Latest revision as of 20:46, 14 March 2023

 This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.

getVBL() Function

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

Introduced in version 1.3b90
Gets the Wall Vision Blocking Layer (Wall VBL) shapes for the area specified in the shape parameter.

Usage

getVBL(shape)
getVBL(shape,format)

This function retrieves the Wall VBL found in the given shape(s).

Parameters

  • shape - A JSON object, or an array of JSON objects, as described in drawVBL(). If an array, gets all the Wall VBL within all provided shapes, otherwise just the Wall VBL in the single provided shape.
  • format - OPTIONAL Boolean. Returns a JSON object if false(0), or a JSON array of coordinates if true(1). In either case, the returned shape covers the Wall VBL found in the area. Defaults to false(0)

Examples

[h:rectangle = '{"shape":"rectangle","x":50,"y":50,"w":100,"h":200,"r":45,"fill":1,"thickness":1,"scale":0}']
[r:vblData   = getVBL(rectangle , 0)]

See Also