Skip to content
BADIM-PC\Vadim edited this page Mar 22, 2017 · 12 revisions

circb

circb x y radius color

Parameters:

  • x : the x coordinate of the circumference center
  • y : the y coordinate of the circumference center
  • r : the radius in pixel of the circumference
  • color: the index of the desired color in the current palette

Description:

It draw a circumference with center x and y of the radius requested.
It use bresenham algorithm.

Example

-- title:  circb demo
-- author: Filippo
-- desc:   circb wiki demo
-- script: lua
-- pal: arne16

a=0
space=10
function TIC()
 cls()
 for i=0,200,space do
  circb(120+80*math.sin(a),
        68+40*math.cos(a),
        i+time()/40%space,
        8)
  circb(120+80*math.sin(a/2),
        68+40*math.cos(a/2),
        i+time()/40%space,
        8) end
 a=a+math.pi/240
end
Clone this wiki locally