Glimmr Drawing Commands

version 2/101030 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - Short forms for image texts

    To image/img text/txt (STR - indexed text) at (COORD1 - a list of numbers) scaled/scale (SCF - a real number) margin (MARGIN - a number) pixels/pixel/px, center-aligned or right-aligned:
        if the type of the current graphics window is not g-graphics:
            say "*** Error: Short-form image string directive ignored. The current graphics window global was not correctly specified.";
            rule fails;
        let x1 be entry 1 of coord1;
        let y1 be entry 2 of coord1;
        if center-aligned:
            paint an image-based text of (STR) in (current graphics window) at (X1) by (Y1) using (current font) scaled at (SCF) with background (current background-color) and margin (MARGIN) px, center-aligned;
            rule succeeds;
        if right-aligned:
            paint an image-based text of (STR) in (current graphics window) at (X1) by (Y1) using (current font) scaled at (SCF) with background (current background-color) and margin (MARGIN) px, right-aligned;
            rule succeeds;
        otherwise:
            paint an image-based text of (STR) in (current graphics window) at (X1) by (Y1) using (current font) scaled at (SCF) with background (current background-color) and margin (MARGIN) px.

    To image/img text/txt (STR - indexed text) at (COORD1 - a list of numbers) scaled/scale (SCF - a real number), center-aligned or right-aligned:
        if the type of the current graphics window is not g-graphics:
            say "*** Error: Short-form image string directive ignored. The current graphics window global was not correctly specified.";
            rule fails;
        let x1 be entry 1 of coord1;
        let y1 be entry 2 of coord1;
        if center-aligned:
            paint an image-based text of (STR) in (current graphics window) at (X1) by (Y1) using (current font) scaled at (SCF), center-aligned;
            rule succeeds;
        if right-aligned:
            paint an image-based text of (STR) in (current graphics window) at (X1) by (Y1) using (current font) scaled at (SCF), right-aligned;
            rule succeeds;
        otherwise:
            paint an image-based text of (STR) in (current graphics window) at (X1) by (Y1) using (current font) scaled at (SCF).