Repository navigation
paint
paint(x, y, color, bordercolor=-1)
- x, y : coordinates of the pixel where the fill starts
- color : the index of the color in the palette that will be used to fill the area; see fill patterns
-
bordercolor : an optional color index the fill stops at.
-1(default) fills the whole contiguous area of the starting pixel's color
This function fills a contiguous area with a new color — the paint-bucket tool of the code layer. Without bordercolor, every pixel connected to (x, y) that has the same color as (x, y) is replaced. With bordercolor, the fill spreads until it reaches a pixel of that color, which lets you fill an area enclosed by an outline.
Calling paint on a screen coordinate outside 0..239 / 0..135 does nothing.
function TIC()
cls(0)
-- an outlined area
circb(60, 68, 40, 12)
circb(60, 68, 30, 12)
-- fill the ring between the two circles with color 4
paint(60, 68 + 35, 4, 12)
-- a plain flood fill
rectb(140, 30, 60, 60, 11)
paint(170, 60, 9)
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