Glimmr Drawing Commands

version 2/101030 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter - Images


    Section - Image

    To drimage (ID - a figure name) in (win - a g-window) at (x1 - a number) by (y1 - a number):
        (- DrawImage({ID}, {win}, {x1}, {y1}); -)

    To display/draw the/-- image/-- (ID - a figure name) in (win - a g-window) at (x1 - a number) by/x (y1 - a number):
        #if utilizing Glimmr debugging;
        say "[>console][DC]Drawing image [ID] in [i][win][/i] at ([x1], [y1]).[<]";
        #end if;
        drimage (ID) in (win) at (x1) by (y1).

    To display/draw the/an/-- image/-- (ID - a figure name) in (win - a g-window) at (coord1 - a list of numbers):
        let x1 be entry 1 of coord1;
        let y1 be entry 2 of coord1;
        drimage (ID) in (win) at (x1) by (y1).

    To image (ID - a figure name) at (coord1 - a list of numbers):
        if the type of the current graphics window is not g-graphics:
            say "*** Error: Short-form image-drawing 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;
        drimage (ID) in (current graphics window) at (x1) by (y1).

    Include (-

    [DrawImage ID win x y ;
        if (win.ref_number) {
            glk_image_draw(win.ref_number, ResourceIDsOfFigures-->ID, x, y);
        }
    ];

    -).