Glimmr Drawing Commands

version 2/101030 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Section: Box

    A box is basically an outlined rectangle. We specify the width of the outline in pixels, in addition to the origin (upper left) and endpoint (lower right) coordinates. In addition, we can indicate whether we want the outline to be drawn inside or outside the imaginary line defined by the coordinates.

        draw a box <color> in <window> from <origin> to <endpoint> with <weight> pixel line-weight
        draw a box <color> in <window> from <origin> to <endpoint> with <weight> pixel line-weight, outlined
        draw a box <color> in <window> from <origin> to <endpoint> with <weight> pixel line-weight, inset

    Long forms:

        draw a box (color g-SkyBlue) in the graphics-window from {120, 12} to {300, 24} with 2 pixel line-weight.
        draw a box (hex #87CEEB) in the graphics-window from 120 by 12 to 300 by 24 with 2 pixel line-weight.
        draw a box (color g-SkyBlue) in the graphics-window from {120, 12} to {300, 24} with 2 pixel line-weight, outlined.
        draw a box (hex #87CEEB) in the graphics-window from 120 by 12 to 300 by 24 with 2 pixel line-weight, inset.

    Short forms:

        box {120, 12} to {300, 24} at 2 px
        box {120, 12} to {300, 24} at 2 px, outlined
        box {120, 12} to {300, 24} at 2 px, inset

    Speed notes:

        A box is drawn using four rectangles, one for each side of the box. It will thus take slightly more time to draw than a rectangle. In practice, and particularly in the best multimedia interpreters, a few boxes on screen should still draw instantaneously.