getMBL: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Change <source> to <syntaxhighlight>)
m (Undo revision 11255 by Kwvanderlinde (talk))
Tag: Undo
Line 9: Line 9:


|usage=
|usage=
<syntaxhighlight lang="mtmacro" line>
<source lang="mtmacro" line>
getMBL(shape,format)
getMBL(shape,format)
</syntaxhighlight>
</source>


This function retrieves the MBL found in the given shape.
This function retrieves the MBL found in the given shape.
Line 20: Line 20:




''Example:''
''Example:''<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:mblData  = getMBL(rectangle , 0)]
[r:mblData  = getMBL(rectangle , 0)]
</syntaxhighlight><br />
</source><br />


|also=
|also=

Revision as of 16:55, 5 May 2021

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

getMBL() Function

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

Introduced in version 1.9.0
Gets the Movement Blocking Layer (MBL) shapes for the area specified in the shape parameter.

Usage

getMBL(shape,format)

This function retrieves the MBL found in the given shape.

Parameters

  • shape - A JSON object as described in drawMBL().
  • format - Boolean. Returns a JSON object if false(0), or an JSON array of coordinates if true(1). In either case, the returned shape covers the MBL found in the area.


Example:

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



See Also