getVBL: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
(First parameter can accept a single shape or multiple shapes; second parameter is optional)
Line 10: Line 10:
|usage=
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
getVBL(shape)
getVBL(shape,format)
getVBL(shape,format)
</source>
</source>


This function retrieves the VBL found in the given shape.
This function retrieves the 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 VBL within all provided shapes, otherwise just the VBL in the single provided shape.}}
{{param|format|Boolean. Returns a JSON object if {{false}}, or an JSON array of coordinates if {{true}}.  In either case, the returned shape 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 VBL found in the area. Defaults to {{false}}}}





Revision as of 14:38, 12 October 2021

 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 Vision Blocking Layer (VBL) shapes for the area specified in the shape parameter.

Usage

getVBL(shape)
getVBL(shape,format)

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


Example:

[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