Repository navigation
rrect
rrect(x, y, width, height, color, radius=-1, exponent=2)
- x, y : coordinates of the top left corner of the rectangle
- width : the width of the rectangle in pixels
- height : the height of the rectangle in pixels
- color : the index of the color in the palette that will be used to fill the rectangle; see fill patterns
-
radius : corner radius in pixels.
-1(default) uses half of the shorter side, giving a capsule;0draws a plain rect -
exponent : shape of the corners.
2(default) is a circle; values below2make the corners more pointed, values above2make them squarer. Clamped to0.3...8
This function draws a filled rounded rectangle (a superellipse capsule) at the specified position.
See also:
- rrectb - draw only the border of the rounded rectangle
function TIC()
cls(0)
-- capsule: radius defaults to half the shorter side
rrect(10, 10, 60, 24, 12)
-- circular corners
rrect(80, 10, 60, 40, 11, 10, 2)
-- squarer corners
rrect(150, 10, 60, 40, 9, 10, 4)
endTIC-80 tiny computer https://tic80.com | Twitter | Telegram | Terms
Built-in Editors
Console
save | export | load | import | menu | config | surf | shelf | demo | eval
Platform
RAM | VRAM | Display | Palette | Bits per Pixel (BPP) |
.ticFormat | Supported Languages
Other
Tutorials | Code Snippets | Libraries | External Tools | FFT
API
Callbacks
Input
Drawing
circ | circb | clip | cls | elli | ellib | font | line | map | paint | pix | print | rect | rectb | rrect | rrectb | spr | tri | trib | ttri | fill patterns
- textri (deprecated)
Sound
Memory
memcpy | memset | mget | mset | peek | poke | pmem | sync | vbank
System