getPitVBL: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page GetPitVBL to getPitVBL: Converting page titles to lowercase)
m (Text replacement - "<source" to "<syntaxhighlight")
Line 9: Line 9:


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
getPitVBL(shape)
getPitVBL(shape)
getPitVBL(shape,format)
getPitVBL(shape,format)
Line 22: Line 22:


|examples=
|examples=
<source lang="mtmacro">
<syntaxhighlight lang="mtmacro">
[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}']
[r:vblData  = getPitVBL(rectangle , 0)]
[r:vblData  = getPitVBL(rectangle , 0)]

Revision as of 19:49, 14 March 2023

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

getPitVBL() Function

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

Introduced in version 1.11.0
Gets the Pit Vision Blocking Layer (Pit VBL) shapes for the area specified in the shape parameter.

Usage

<syntaxhighlight lang="mtmacro" line> getPitVBL(shape) getPitVBL(shape,format) </source>

This function retrieves the Pit 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 Pit VBL within all provided shapes, otherwise just the Pit 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 Pit VBL found in the area. Defaults to false(0)

Examples

<syntaxhighlight lang="mtmacro">

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

</source>

See Also