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...
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
0 or not present
combo box collapsed, text normal
none
Only available on Taranis
Draw a straight line on LCD
@status current Introduced in 2.0.0, flags introduced in 2.3.6
x1,y1
(positive numbers) starting coordinate
x2,y2
(positive numbers) end coordinate
pattern
SOLID or DOTTED
flags
lcdflags
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)
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
(unsigned number) drawing flags
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) lcdflags
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!)
Lcd functions allow scripts to interact with the transmitter display. This access is limited to the 'run' functions of One-Time and Telemetry scripts. Widget scripts on the Horus (X10 and X12S) can make use of the lcd functions as well.
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.
Many of the lcd functions accept parameters named flags and patterns. The names and their meanings are described below.
Name
Description
Version
Notes
0
normal font, default precision for numeric
DBLSIZE
double size font
MIDSIZE
mid sized font
SMLSIZE
small font
INVERS
inverted display
BLINK
blinking text
XXLSIZE
jumbo font
2.0.6
LEFT
left justify
2.0.6
Default for most functions not related to bitmaps
RIGHT
right justify
PREC1
single decimal place
PREC2
two decimal places
GREY_DEFAULT
grey fill
TIMEHOUR
dislay hours
Only for drawTimer
Name
Description
FORCE
pixels will be black
ERASE
pixels will be white
DOTTED
lines will appear dotted
Name
Description
LCD_W
width in pixels
LCD_H
height in pixels
Radio
LCD_W
LCD_H
Colours
X7
128
64
1 bit
X9D
212
64
4 bit
X9D+
212
64
4 bit
X9E
212
64
4 bit
X10
480
272
RGB565
X12S
480
272
RGB565
Returns a 5/6/5 rgb color code, that can be used with lcd.setColor
@status current Introduced in 2.2.0
r
(integer) a number between 0x00 and 0xff that expresses te amount of red in the color
g
(integer) a number between 0x00 and 0xff that expresses te amount of green in the color
b
(integer) a number between 0x00 and 0xff that expresses te amount of blue in the color
number
(integer) rgb color expressed in 5/6/5 format
Only available on Colorlcd radios
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
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
(unsigned number) drawing flags
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
(unsigned number) drawing flags
t
(number) thickness in pixels, defaults to 1 (only on Horus)
none
Display a number at (x,y)
@status current Introduced in 2.0.0, SHADOWED
introduced in 2.2.1
x,y
(positive numbers) starting coordinate
value
(number) value to display
flags
(unsigned number) drawing flags:
0 or not specified
display with no decimal (like abs())
PREC1
display with one decimal place (number 386 is displayed as 38.6)
PREC2
display with tow decimal places (number 386 is displayed as 3.86)
other general LCD flag also apply
SHADOWED
Horus only, apply a shadow effect
none
Display a value formatted as time at (x,y)
@status current Introduced in 2.0.0, SHADOWED
introduced in 2.2.1
x,y
(positive numbers) starting coordinate
value
(number) time in seconds
flags
(unsigned number) drawing flags:
0 or not specified
normal representation (minutes and seconds)
TIMEHOUR
display hours
other general LCD flag also apply
SHADOWED
Horus only, apply a shadow effect
none
Draw a text beginning at (x,y)
@status current Introduced in 2.0.0, SHADOWED
introduced in 2.2.1
x,y
(positive numbers) starting coordinate
text
(string) text to display
flags
(unsigned number) drawing flags. All values can be combined together using the + character. ie BLINK + DBLSIZE. See the Appendix for available characters in each font set.
0 or not specified
normal font
XXLSIZE
jumbo sized font
DBLSIZE
double size font
MIDSIZE
mid sized font
SMLSIZE
small font
INVERS
inverted display
BLINK
blinking text
SHADOWED
Horus only, apply a shadow effect
none
Set a color for specific area
@status current Introduced in 2.2.0
area
(unsigned number) specific screen area in the list bellow
TEXT_COLOR
TEXT_BGCOLOR
TEXT_INVERTED_COLOR
TEXT_INVERTED_BGCOLOR
LINE_COLOR
SCROLLBOX_COLOR
MENU_TITLE_BGCOLOR
MENU_TITLE_COLOR
MENU_TITLE_DISABLE_COLOR
HEADER_COLOR
ALARM_COLOR
WARNING_COLOR
TEXT_DISABLE_COLOR
CURVE_AXIS_COLOR
CURVE_COLOR
CURVE_CURSOR_COLOR
TITLE_BGCOLOR
TRIM_BGCOLOR
TRIM_SHADOW_COLOR
HEADER_BGCOLOR
HEADER_ICON_BGCOLOR
HEADER_CURRENT_BGCOLOR
MAINVIEW_PANES_COLOR
MAINVIEW_GRAPHICS_COLOR
OVERLAY_COLOR
BARGRAPH1_COLOR
BARGRAPH2_COLOR
BARGRAPH_BGCOLOR
CUSTOM_COLOR
color
(number) color in 5/6/5 rgb format. The following prefined colors are available
WHITE
GREY
LIGHTGREY
DARKGREY
BLACK
YELLOW
BLUE
RED
DARKRED
none
Only available on Colorlcd radios
Draw a text representation of switch at (x,y)
@status current Introduced in 2.0.0
x,y
(positive numbers) starting coordinate
switch
(number) number of switch to display, negative number displays negated switch
flags
(unsigned number) drawing flags, only SMLSIZE, BLINK and INVERS.
none