lcd.drawRectangle¶
since 1.1.0
Draw a rectangle.
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
x |
number | yes | X coordinate |
y |
number | yes | Y coordinate |
w |
number | yes | rectangle width |
h |
number | yes | rectangle height |
thickness |
integer | optional (default 1) |
the thickness of the rectangle frame |
Returns¶
Nothing.
Examples¶
lcd.drawRectangle(10, 10, 100, 40) -- 1 px outline
lcd.drawRectangle(10, 60, 100, 40, 3) -- 3 px thick outline
-- highlight the focused element
if lcd.hasFocus() then
lcd.color(lcd.themeColor(THEME_FOCUS_COLOR))
lcd.drawRectangle(0, 0, w, h, 2)
end
Used in¶
Real-world usage¶
Called 116 times across 10 open-source Ethos Lua projects. A few short excerpts: