DOWN

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, DOWN activates the drawing process; the pen must be down for any drawing to take place.
The opposite of down is up, which deactivates drawing.

Syntax

This command is NOT case sensitive.
  1. #handle "down" - a graphics window
  2. #handle.ext "down" - a graphicbox

Hints

With some commands, the pen can be moved when it is down without anything being drawn. With others, you will have to issue an "up" command to keep from drawing while the pen is repositioned. See the various graphics commands for the differences.
  • Graphics text will print - even with the pen up as long as some command has been issued that will position the pen in the window. See the example.

Example

An example of the command in a graphics window.

To see a difference, comment out the line with the "up" command and run the program again.

nomainwin

    WindowWidth=400
    WindowHeight=300

    open "Down Demo" for graphics_nsb_nf as #g
    #g "trapclose [quit]"
    'put the pen down
    #g "down; place 10 10"
    #g "box 100 100"

    'lift pen up
    #g "up"
    #g "place 100 100; circle 50"
    #g "\Circle is not drawn, but text is!"
    wait

[quit]
    close #g
    end

An example of the command in a graphicbox.

nomainwin

    WindowWidth=400
    WindowHeight=300

    graphicbox #g.gb 0, 0, 390, 270
    open "Down Demo" for window_nf as #g
    #g "trapclose [quit]"
    'put the pen down
    #g.gb "down; place 10 10"
    #g.gb "box 100 100"

    'lift pen up
    #g.gb "up"
    #g.gb "place 100 100; circle 50"
    #g.gb "\Circle is not drawn, but text is!"
    wait

[quit]
    close #g
    end

Useful Procedures

' Place a useful function or sub using this keyword here