-
Notifications
You must be signed in to change notification settings - Fork 3
BLOCKS VALUE
VALUE BLocks are readable. They have a value type (Null
, Number
, String
, Boolean
, Color
, Object
) and, depending on where they're used, can be read differently.
A Number
type can be converted to a Color
type if needed. The object type means that the Value needs to be calculated first, as if there was a MATH
Block in it.
Gets a number from BMG's state. Has access to the drawer, map data, etc. Please reference the schema to have the enum list suggested to you.
The key of the data.
{
"type": "NUMBER",
"key": "MAP->INDEX"
}
A Color value.
The red value.
The green value.
The blue value.
{
"type": "COLOR",
"r": 218,
"g": 51,
"b": 63
}
Gets a parameter that was passed when running this function. Cannot request a parameter that wasn't registered in the function's header.
The key of the parameter.
{
"type": "PARAMETER",
"name": "user_color_1"
}
These types of VALUE blocks can solve Number
or Color
equations. These blocks can help you get the number you need by calculating. Most blocks take 2 inputs and accept Numbers
or Colors
, only a few blocks are exceptional). If any input of a math block is of a Color
type, then it will yield a Color
output.
Returns the added value of a
and b
.
The first input.
The second input.
{
"type": "+",
"a": 2,
"b": 7
}
Returns the subtracted value of a
, having taken away the value in b
.
The first input.
The second input.
{
"type": "-",
"a": 20.3,
"b": 11.3
}
Returns the multiplied value of a
and b
.
The first input.
The second input.
{
"type": "*",
"a": 18,
"b": 0.5
}
Returns the divided value of a
, using the divisor in b
. If both inputs are Numbers
, keep in mind that the result could have a floating point.
The first input.
The second input.
{
"type": "/",
"a": 27,
"b": 3
}
Returns the floored divided value of a
, using the divisor in b
. Only works for Number
operations. The Number
returned will never have a floating point.
The first input.
The second input.
{
"type": "//",
"a": 8,
"b": 0.85
}
Returns the remainder when dividing a
by b
.
The first input.
The second input.
{
"type": "%",
"a": 48,
"b": 13
}
New in 1.1
Returns the value when raising the value in base
to the exponent
. Can also be used to root the number.
The base, what to raise.
ALLOWED TYPES:
Number
,MATH
The exponent, how much to raise.
{
"type": "POW",
"base": 3,
"exponent": 2
}
New in 1.1
Returns the the input
's square root.
The input of the SQUARE ROOT Block.
{
"type": "SQRT",
"input": 81
}