-
-
Notifications
You must be signed in to change notification settings - Fork 492
elli
TimotheeGreg edited this page Aug 25, 2023
·
11 revisions
This was added to the API in version 0.90.
elli(x, y, a, b, color)
- x, y : the coordinates of the ellipse's center
- a : the horizontal radius of the ellipse in pixels
- b : the vertical radius of the ellipse in pixels
- color: the index of the desired color in the current palette
This function draws a filled ellipse centered at x, y using palette index color and radii a and b. It uses the Bresenham algorithm.
See also:
- ellib - draw only the boundary of the ellipse
-- title: ellipse example
-- author: paul59
-- script: lua
local CX,CY=120,68
local RED,GREEN=2,6
local MIN,MAX=8,48
local hrad,vrad=16,16
function TIC()
if btn(0) and vrad<MAX then vrad=vrad+1 end
if btn(1) and vrad>MIN then vrad=vrad-1 end
if btn(2) and hrad<MAX then hrad=hrad+1 end
if btn(3) and hrad>MIN then hrad=hrad-1 end
cls(0)
print('Use the cursor keys to adjust size',24,2,13)
--draw filled ellipse
elli(CX,CY,hrad,vrad,RED)
--draw outline ellipse
--swap the horizontal and vertical radii
ellib(CX,CY,vrad,hrad,GREEN)
end
TIC-80 tiny computer https://tic80.com | Twitter | Telegram | Terms
Built-in Editors
Console
Platform
RAM & VRAM | Display | Palette | Bits per Pixel (BPP) |
.tic
Format | Supported Languages
Other
Tutorials | Code Snippets | Libraries | External Tools | FFT
API
- BDR (0.90)
- BOOT (1.0)
- MENU
- OVR (deprecated)
- SCN (deprecated)
- TIC
- btn & btnp
- circ & circb
- clip
- cls
- elli & ellib (0.90)
- exit
- fget & fset (0.80)
- font
- key & keyp
- line
- map
- memcpy & memset
- mget & mset
- mouse
- music
- peek, peek4
- peek1, peek2 (1.0)
- pix
- pmem
- poke, poke4
- poke1, poke2 (1.0)
- rect & rectb
- reset
- sfx
- spr
- sync
- ttri (1.0)
- time
- trace
- tri & trib (0.90)
- tstamp (0.80)
- vbank (1.0)