Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Returns a drawing flag with RGB color code
@status current Introduced in 2.2.0
r (integer) a number between 0 and 255 that expresses the amount of red in the color
g (integer) a number between 0 and 255 that expresses the amount of green in the color
b (integer) a number between 0 and 255 that expresses the amount of blue in the color
rgb (integer) a number between 0 and 0xFFFFFF that expresses the RGB value (0xFF0000=RED, 0x00FF00=GREEN, 0x0000FF=BLUE)
flag with RGB565 color
Only available on radios with color display. Use either lcd.RGB(r,g,b) or lcd.RGB(rgb).
Lcd functions allow scripts to interact with the transmitter display. This access is limited to the run function of One-Time and Telemetry scripts, and the refresh function of Widget scripts on radios with color display.
The run function is periodically called when the screen is visible. In OpenTX 2.0 each invocation starts with a blank screen (unless lcd.lock() is used). Under OpenTX 2.1 screen state is always persisted across calls to the run function. Many scripts originally written for OpenTX 2.0 require a call to lcd.clear() at the beginning of their run function in order to display properly under 2.1 and 2.2.
For Widget scripts, lcd.clear() is not needed, as each invocation starts with a blank screen showing the theme background. But it can be used to overwrite the theme background with another color by calling lcd.clear(color).
Please see above for a description of the constants for , , and that can be used with lcd drawing functions.
Displays a bitmap at (x,y)
@status current Introduced in 2.2.0
bitmap (pointer) point to a bitmap previously opened with Bitmap.open()
x,y (positive numbers) starting coordinates
scale (positive numbers) scale in %, 50 divides size by two, 100 is unchanged, 200 doubles size. Omitting scale draws image in 1:1 scale and is faster than specifying 100 for scale.
none
Only available on Horus
Displays a bitmap pattern at (x,y)
@status current Introduced in 2.8.0
Parameters
bitmap (pointer) point to a bitmap previously opened with Bitmap.open()
x,y (positive numbers) starting coordinates
x2,y2 (positive numbers) end coordinate
pattern SOLID or DOTTED
none
If the start or the end of the line is outside the LCD dimensions, then the whole line will not be drawn (starting from OpenTX 2.1.5)
value (number) time in seconds
inversColor (optional with INVERS flag) overrides the inverse text color for INVERS
none
r (number) radius in pixels
none
flags (optional) please see Lcd functions overview
Return value
none
Notice
Only available on Horus
none
xmin,xmax,ymin,ymax (positive numbers) the limits of the rectangle
none
Draw a single pixel at (x,y) position
@status current Introduced in 2.0.0
x (positive number) x position
y (positive number) y position
flags (optional) please see and constants
none
Taranis has an LCD display width of 212 pixels and height of 64 pixels. Position (0,0) is at top left. Y axis is negative, top line is 0, bottom line is 63. Drawing on an existing black pixel produces white pixel (TODO check this!)
Displays a bitmap pattern pie at (x,y)
@status current Introduced in 2.8.0
Parameters
bitmap (pointer) point to a bitmap previously opened with Bitmap.open()
x,y (positive numbers) starting coordinates
Invert a rectangle zone from top left corner (x,y) of specified width and height
@status current Introduced in 2.8.0
Parameters
x,y (positive numbers) top left corner position
w (number) width in pixels
startAngle Start angle
endAngle End angle
flags (optional) please see Lcd functions overview
Return value
none
Notice
Only available on Horus
source (number) source index
none
w,h (positive numbers) width and height of bounding rectangle
text (string) text to display
flags (optional) please see Lcd functions overview for drawing flags and colors, and Appendix for available characters in each font set. RIGHT, CENTER and VCENTER are not implemented.
none
Color radios only.
text (string) text to display
inversColor (optional with the INVERS flag) overrides the inverse text color for INVERS
none
xmin,xmax,ymin,ymax (positive numbers) the limits of the rectangle inside which the line is drawn
pattern (FORCE, ERASE, DOTTED) please see Lcd functions overview
none
none
none
none
none
h (number) height in pixels
flags (optional) please see Lcd functions overview
Return value
none
number (integer) x position
Only available on Taranis
switch (number) number of switch to display, negative number displays negated switch
flags (optional) please see flags constants, only SMLSIZE, BLINK and INVERS.
none
color (flag) only the RGB565 color value of the input
Only available on radios with color display
Draw a combo box
@status current Introduced in 2.0.0
x,y (positive numbers) top left corner position
w (number) width of combo box in pixels
list (table) combo box elements, each element is a string
idx (integer) index of entry to highlight
flags (unsigned number) drawing flags, the flags can not be combined:
BLINK combo box is expanded
INVERS combo box collapsed, text inversed
none
Only available on Taranis
Draw a solid rectangle from top left corner (x,y) of specified width and height
@status current Introduced in 2.0.0
x,y (positive numbers) top left corner position
w (number) width in pixels
h (number) height in pixels
flags (optional) please see and constants
opacity (number) opacity defaults to 0 (only on Horus)
none
Draw a rectangle from top left corner (x,y) of specified width and height
@status current Introduced in 2.0.0, changed in 2.2.0
x,y (positive numbers) top left corner position
w (number) width in pixels
h (number) height in pixels
flags (optional) please see and constants
t (number) thickness in pixels, defaults to 1 (only on Horus)
opacity (number) opacity defaults to 0 (only on Horus)
none
Draw a simple gauge that is filled based upon fill value
@status current Introduced in 2.0.0, changed in 2.2.0
x,y (positive numbers) top left corner position
w (number) width in pixels
h (number) height in pixels
fill (number) amount of fill to apply
maxfill (number) total value of fill
flags (optional) please see and constants
none
Change an indexed color (theme colors and CUSTOM_COLOR).
@status current Introduced in 2.2.0
Changing theme colors affects not only other Lua widgets, but the entire radio interface.
Only available on radios with color display
colorIndex (flags) must be an indexed color, please see constants.
color (flags) please see constants.
none
Only available on radios with color display
Display a telemetry value at (x,y)
@status current Introduced in 2.0.6, changed in 2.1.0 (only telemetry sources are valid)
x,y (positive numbers) starting coordinate
source can be a source identifier (number) or a source name (string). See getValue()
flags (optional) please see and constants
none
0 or not present combo box collapsed, text normal
page (number) page number
pages (number) total number of pages. Only used as indicator on the right side of title bar. (i.e. idx=2, cnt=5, display 2/5)
none
Only available on Taranis
r (number) radius in pixels
none