Oval x,y,width,height[,solid]
Parameters
|
x - x coordinate of the top-left corner of the oval's bounding box y - y coordinate of the top-left corner of the oval's bounding box width - width of the bounding box, in pixels height - height of the bounding box, in pixels solid (optional) - 1 draws a filled oval (default); 0 draws just the outline |
Description
|
Draws an oval in the current drawing colour, filled or as an outline. The oval is drawn inside the rectangle you describe: x,y is the box's top-left corner, and the oval touches the box on all four sides. Equal width and height give a circle - to draw a circle around a centre point, use Oval cx-r,cy-r,r*2,r*2. Balls, shadow blobs, radar circles, explosion flashes - filled by default, outline with solid 0. The colour comes from Color, coordinates respect Origin, and drawing is clipped to the Viewport. See also: Rect, Line, Plot, Color. |
Example
; Oval Example ; ------------ Graphics 640,480,0,2 SetBuffer BackBuffer() SeedRnd MilliSecs() ; A tank of rising bubbles Dim bx(11),by#(11),size(11),spd#(11) For i=0 To 11 bx(i)=Rand(20,580) by(i)=Rnd(0,480) size(i)=Rand(10,50) spd(i)=Rnd(1,3) Next While Not KeyDown(1) Cls For i=0 To 11 ; Bubbles float upwards and respawn at the bottom by(i)=by(i)-spd(i) If by(i)<-60 Then by(i)=480 bx(i)=Rand(20,580) EndIf ; Alternate the solid flag: odd bubbles filled, even ones outlined Color 80+i*14,180,255 Oval bx(i),by(i),size(i),size(i),i Mod 2 Next Color 255,255,255 Text 0,0,"Esc: exit" Text 0,20,"Oval x,y,width,height,solid - solid=1 filled, solid=0 outline" Flip Wend End
Index