DRAW
Main loop performing painting operations on the board built into LOFI Blocks. All blocks placed in the DRAW LOOP will be “drawn” on the board 25 times per second.
Draw loop ignores the WAIT delay block – it can not be stopped.
In the drawing loop, you can also place normal blocks – for example, controlling the robot. However, because the loop is performed without any delays, it can lead to disturbances, eg. when communicating with a robot via Bluetooth due to too much information being sent.
Text
A block that creates a text variable.
Parameters:
Placing a text variable in a field designed for numbers or logical variables will cause an error in the code that will prevent the execution of the block containing it.
Line
The block draws on the table a straight line between the starting point defined by the coordinates X1 and Y1 and the endpoint determined by the coordinates X2 and Y2.
Parameters:
- Coordinates of the starting point X1 (horizontal) and Y1 (vertical).
- Coordinates of the end point X1 (horizontal) and Y1 (vertical).
Rotation
Reporting block – returning the value read from the indicated input.
Parameters:
- Angle of rotation – range 0 – 100 corresponds to a rotation in the range of 0 – 360 degrees.
- Center of rotation – coordinates of the point relative to which objects inside the DRAW block are moved and rotated.
The operation of the DRAW block may appear chaotic at first glance. All objects placed in the draw block are moved to the point specified by the coordinates of the center of rotation and then rotated by the given value. For example, to rotate a square with sides 50 by 50 in relation to its center, place it in the drawing block specifying as square coordinates X = -25, Y = -25.
Stroke
The block determining the thickness and color of the line drawn with the LINE block.
Parameters:
- Thickness – specified in pixels.
- R – Red – value of the red component.
- G – Green – value of the green color component.
- B – Blue – the value of the blue component.
- A – Alpha – value of the constituent of transparency.
Rectangle
A block that draws a rectangle starting from the upper left corner at a point with coordinates (X, Y), a given width and height, filled with the color specified by the FILLING block.
Parameters:
- X – horizontal coordinate of the upper left corner of the rectangle, given in pixels in the range 0-100.
- Y – vertical coordinate of the upper left corner of the rectangle, given in pixels in the range 0-100.
- WIDTH – width of the rectangle, given in pixels in the range 0-100.
- HEIGHT – the height of the rectangle, given in pixels in the range 0-100.
X and Y coordinates and width and height values may have negative values or greater than 100, they will then be outside the area of the drawing field.
Infill
A block defining the color of filling elements drawn by RECTANGLE, ELLIPS and TEXT blocks.
Parameters:
- R – Red – value of the red component.
- G – Green – value of the green color component.
- B – Blue – the value of the blue component.
- A – Alpha – value of the constituent of transparency.
Infill is valid for all drawing blocks that follow it, until we change it again using the INFILL block.
Ellipse
The block draws the ellipse starting from the upper left corner at the point with coordinates (X, Y), the given width and height, filled with the color specified by the FILLING block.
Parameters:
- X – the horizontal coordinate of the center of the ellipse, given in pixels in the range 0-100.
- Y – the vertical coordinate of the center of the ellipse, given in pixels in the range 0-100.
- WIDTH – the width of the ellipse, given in pixels in the range 0-100.
- HEIGHT – the height of the ellipse, given in pixels in the range 0-100.
X and Y coordinates and width and height values may have negative values or greater than 100, they will then be outside the area of the drawing field.
Text
A block that draws text starting from the upper left corner at a point with coordinates (X, Y) of a given font height, filled with the color specified by the FILLING block.
Parameters:
- TEXT – content to be written in the drawing field, defined by a text variable block.
- Size – font height, 15px by default.
- X – horizontal coordinate of the upper left corner of the text field, given in pixels in the range 0-100.
- Y – vertical coordinate of the upper left corner of the text field, given in pixels in the range 0-100.
X and Y coordinates can have negative values or greater than 100, they will be located outside the area of the drawing field.