drawVBL
This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.
This article needs: Lacks examples.
drawVBL() Function
Note: This function can only be used in a Trusted Macro
• Introduced in version 1.3b89
This function draws VBL shapes.
Usage
drawVBL(shapesList)
Parameters
shapesList
- A JSON Array of JSON objects, one of the latter for each VBL shape.
The shapes can be one of "Rectangle"
, "Circle"
, "Polygon"
or "Cross"
.
For "shape":"Rectangle"
:
"x"
- Abscissa in pixels. (aka: X-Coordinate)"y"
- Ordinate in pixels. (aks: Y-Coordinate)"w"
- Width in pixels."h"
- Height in pixels."r"
- Rotation on centre axis in degrees, clockwise. Using default mathematical system: '0' is no rotation, + is clockwise, - is counterclockwise. Optional."facing"
- Rotation on centre axis in degrees, clockwise. Using the MT facing system: '0' will rotate the shape 90 degrees anticlockwise, + is counterclockwise, - is clockwise. When using both 'r' and 'facing', then 'facing' takes precedence. Optional."rx"
- Rotation centre offset in pixels. Optional."ry"
- Rotation centre offset in pixels. When used the centre over which the shape is rotated is positioned at the rx,ry coordinate. The centre defaults to the actual centre of the shape. Optional."fill"
- If1
fills rectangle, otherwise creates empty shape. Optional."thickness"
- Line thickness from2
ton
pixels. Lower than2
or empty defaults to2
. Even numbers only (odd numbers get rounded down by one). Can't be bigger than width or height. Optional."scale"
- If provided number not0
, will scale rectangle byx
, ie scale:2
is double, scale:0.5
is half. Optional.
- Example:
{"shape":"rectangle","x":1743,"y":2198,"w":100,"h":100,"r":45,"fill":1,"thickness":1,"scale":0}
For "shape":"Circle"
:
"x"
- Abscissa in pixels."y"
- Ordinate in pixels."radius"
- In pixels."fill"
- If1
fills circle, otherwise creates empty shape. Optional."thickness"
- Line thickness from2
ton
pixels. Lower than2
or empty defaults to2
. Even numbers only (odd numbers get rounded down by one). Optional."sides"
- Specifies how many sides the polygon will have to approximate a circle, from3
to100
.
- Example:
{"shape":"circle", "X":50, "Y":100, "radius":200, "sides":12, "thickness":3, "fill":0}
For "shape":"Polygon"
:
"r"
- Rotation on centre axis in degrees, clockwise."thickness"
- Line thickness from2
ton
pixels. Lower than2
or empty defaults to2
. Even numbers only (odd numbers get rounded down by one). Optional."close"
- If1
then it will close the polygon otherwise it will leave it open. Optional."fill"
- If1
and"close"
is set too fills polygon, otherwise creates empty shape. Optional."points"
- JSON Array of 2 or more"x"
,"y"
coordinates.
- Example:
{"shape":"polygon","r":0,"fill":1,"close":1,"thickness":10,"points":[{"x":1993,"y":1998},{"x":2043,"y":1998},{"x":1993,"y":2148}]}
For "shape":"Cross"
:
"x"
- Abscissa in pixels."y"
- Ordinate in pixels."w"
- Width in pixels."h"
- Height in pixels."r"
- Rotation on centre axis in degrees, clockwise."thickness"
- Line thickness from2
ton
pixels. Lower than2
or empty defaults to2
. Even numbers only (odd numbers get rounded down by one). Can't be bigger than width or height. Optional."scale"
- If provided number not0
, will scale cross byx
, ie scale:2
is double, scale:0.5
is half. Optional.
- Example:
{"shape":"cross","x":1593,"y":2198,"w":50,"h":50,"r":22,"thickness":5,"scale":0.75}
Example
This example doesn't really do anything.
[h: exampleVariable = "a,b,c"]
[r: exampleFunction(exampleVariable, reverse)]
Returns:
c,b,a