Circle.sel

#!./Selene
--- Draw a circle in the middle of the screen

Selene.UseDirectFB("--dfb:quiet,no-vt")
DirectFB.init( DirectFB.CooperativeConst('FULLSCREEN') );	-- Set display cooperative mode

srf = SelSurface.create { caps=SelSurface.CapabilityConst('PRIMARY') } -- create a primary surface
local w,h = srf:GetSize()	-- Retrieve its size
local r = w/3
if h < w then
	r = h/3
end

srf:SetColor( 0xff, 0x80, 0x80, 0x80)	-- Orange
srf:DrawCircle( w/2, h/2, r )	-- Full circle

	-- Quarter
srf:DrawCircle( w/2, h/2, r+05, SelSurface.CircleQuarterConst('Q1') )
srf:DrawCircle( w/2, h/2, r+10, SelSurface.CircleQuarterConst('Q2') )
srf:DrawCircle( w/2, h/2, r+15, SelSurface.CircleQuarterConst('Q3') )
srf:DrawCircle( w/2, h/2, r+20, SelSurface.CircleQuarterConst('Q4') )

srf:SetColor( 0x80, 0x80, 0x80, 0x80)	-- semi transparent grey
srf:FillCircle( w/2, h/2, r-10 )

srf:SetColor( 0xff, 0x00, 0x00, 0x00)
srf:FillCircle( w/2, h/2, r-20, SelSurface.CircleQuarterConst('Q1') )

srf:SetColor( 0x00, 0xff, 0x00, 0x00)
srf:FillCircle( w/2, h/2, r-20, SelSurface.CircleQuarterConst('Q2') )

srf:SetColor( 0x00, 0x00, 0xff, 0x00)
srf:FillCircle( w/2, h/2, r-20, SelSurface.CircleQuarterConst('Q3') )

srf:SetColor( 0xff, 0xff, 0x00, 0x00)
srf:FillCircle( w/2, h/2, r-20, SelSurface.CircleQuarterConst('Q4') )

print "Hit 'enter' key to exit"
io.stdin:read'*l'	-- wait for enter

srf:destroy()
generated by LDoc 1.4.6 Last updated 2022-09-05 22:24:51