Skip to content

10011: Draw Element

Draw an element

Payload

FieldNameDescriptionTypeUnit
3Page IDThe page to draw or update.
Page ids 0-10 are reserved for system use.
If no page id is provided, page id 11 will be assumed.
uint8
5Status bar EnableShow the status barbool
6Redraw TypePossible values:
  • 0: Auto— Automatically choose the redraw type
  • 1: PartialRedraw— Only redraw the parts of the screen changed in this message
  • 2: FullRedraw— Clear the screen buffer, and redraw the entire screen
  • 3: BufferOnly— Update the buffer only, do not redraw
  • 4: FullRedrawWithoutClear— Redraw the entire screen, without clearing the buffer
  • 5: ClearDontDraw— Clear the screen buffer, but don't redraw
uint8
7XX coordinate for the start of the element. If padded, this is the start of the padded area.uint
8YY coordinate for the start of the element. If padded, this is the start of the padded area.uint
9WidthWidth of the element. If padded this does not include the padding.uint
10HeightHeight of the element. If padded this does not include the padding.uint
11TypeType of element to draw
Possible values:
  • 0: Box— Draw a Box. Requires x, y (top left corner), width and height. Can include style, and padding Can include text and a font size and alignment. Can have corners rounded with the radius parameter. Can have a border with the line width parameter.
  • 1: Circle— Draw a circle. Requires x, y (top left corner) and width. Can have a border with the line width parameter.
  • 2: Line— Draw a line. Requires x, y (start point), width and height (end point). Can have line width and line type (dashed or solid).
  • 3: Bitmap— Draw a bitmap, from provided data. Requires x, y (top left corner), width, height and bitmap data.
uint8
12StyleStyle of the element to draw. Default is BlackOnClear.
Possible values:
  • 0: BlackOnClear
  • 1: WhiteOnBlack
  • 2: BlackOutline
  • 3: WhiteOutline
uint8
13FontSizeSize of the font to use. Default is Medium.
Possible values:
  • 0: Small
  • 1: Medium
  • 2: Large
uint8
14TextAlignAlignment of the text. Default is Middle.
Possible values:
  • 0: Left
  • 1: Middle
  • 2: Right
uint8
15LineWidthDefault is 1. Max is 8.uint8
16PaddingPadding inside the element (in terms of x and y). Default is 0.uint8
17RadiusFor use with circle, or corner rounding. Default is 0.uint8
18LineTypeDefault is Solid.
Possible values:
  • 0: Solid
  • 1: Dashed
uint8
19X2Second X coordinate, primarily for lines. Min 0, Max WIDTH -1.uint
20Y2Second Y coordinate, primarily for lines. Min 0, Max HEIGHT -1.uint
25Bitmapbytes
100Textascii

Element types

Box

Box with text

Line

Circle

Bitmap

Examples

Draw circle in the middle of a page
Draw a horizontal line across the middle of the page
Draw a 40x40 lightbug logo in the top left of the screen
Write the string "Lightbug..." in the top left of the screen in a box

Code

For convenience, the following constants can be used to reference this message type.