BOXFILLED

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 graphicboxes, BOXFILLED draws a color-filled box shape using the pen position as one corner and x y as the other corner.
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 "boxfilled x y" - a graphics window
  2. #handle.ext "boxfilled x y" - a graphicbox

Using variable values

  1. #handle "boxfilled ";x;" "; y
  2. #handle.ext "boxfilled ";x;" "; y
The upper-left corner of the box is at the pen position. The lower-right corner will be at the specified x y coordinates.

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 Boxfilled 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 upper left corner
    #g "place 30 40"
    'draw a 100 x 100 box
    #g "boxfilled 150 150"

    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 Boxfilled Demo" for window_nf as #g
    #g "trapclose [quit]"
    'put the pen down and set fill color
    #g.gb "down; backcolor blue"
    'set pen color and size for shape
    #g.gb "color yellow; size 3"
    'place the pen at upper left corner
    #g.gb "place 50 50"
    'draw a 100 x 100 box
    #g.gb "boxfilled 150 150"

    wait

[quit]
    close #g
    end

Useful Procedures

' Place a useful function using this keyword here