ELLIPSEFILLED

From Liberty BASIC Family
Jump to navigation Jump to search
Supported in Just BASIC Supported in Liberty BASIC Not supported in Liberty BASIC 5 Not supported in Run BASIC

Description

For use with graphics windows and graphic-boxes, ELLIPSEFILLED draws a color-filled ellipse shape centered at the pen position and w wide by h high.
The fill color of filled shapes is set with the backcolor command.
There are four graphics commands that draw filled shapes:
boxfilled
circlefilled
ellipsefilled
piefilled

Syntax

This command is NOT case sensitive.

Using literal values

  1. #handle "ellipsefilled w h" - a graphics window
  2. #handle.ext "ellipsefilled w h" - a graphicbox

Using variable values

  1. #handle "ellipsefilled ";w;" "; h
  2. #handle.ext "ellipsefilled ";w;" "; h
w and h are the width and height of the ellipse.

Hints

Color & Size. Shapes are drawn with a pen color set by the color command and a line thickness set by the size command. The fill color is set with the backcolor command.

Example

An example of the command in a graphics window.

nomainwin

    WindowWidth=400
    WindowHeight=300

    open "Draw Ellipsefilled Demo" for graphics_nsb_nf as #g
    #g "trapclose [quit]"
    'put the pen down and set fill color
    #g "down; backcolor 127 127 127"
    'place pen at center of ellipse
    #g "place 200 140"
    'draw an ellipse 200 wide by 100 high
    #g "ellipsefilled 200 100"

    wait

[quit]
    close #g
    end

An example of the command in a graphicbox.

nomainwin

    WindowWidth=400
    WindowHeight=300

    graphicbox #g.gb 2, 2, 390, 270
    open "Draw Ellipsefilled Demo" for window_nf as #g
    #g "trapclose [quit]"
    'put the pen down and set fill color
    #g.gb "down; backcolor blue"
    'place pen at center of ellipse
    #g.gb "place 150 140"
    'draw an ellipse 100 wide by 60 high
    #g.gb "ellipsefilled 100 60"

    wait

[quit]
    close #g
    end

Useful Procedures

' Place a useful function or sub using this keyword here