Glimmr Drawing Commands

version 2/101030 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - Image with specified size

    To drscimage (ID - a figure name) in (win - a g-window) at (x1 - a number) by/x (y1 - a number) with size/dimensions (width - a number) by/x (height - a number):
        (- DrawImageScaled({ID}, {win}, {x1}, {y1}, {width}, {height}); -)
        
    To display/draw the/an/-- image/-- (ID - a figure name) in (win - a g-window) at (x1 - a number) by/x (y1 - a number) with size/dimensions (width - a number) by/x (height - a number):
        #if utilizing Glimmr debugging;
        say "[>console][DC]Drawing image [ID] in [i][win][/i] at ([x1], [y1]), scaled to dimensions [width] x [height].[<]";
        #end if;
        drscimage (ID) in (win) at (x1) by (y1) with dimensions (width) by (height).

    To display/draw the/an/-- image/-- (ID - a figure name) in (win - a g-window) at (coord1 - a list of numbers) with size/dimensions (width - a number) by/x (height - a number):
        let x1 be entry 1 of coord1;
        let y1 be entry 2 of coord1;
        drscimage (ID) in (win) at (x1) by (y1) with dimensions (width) by (height).

    To image (ID - a figure name) at (coord1 - a list of numbers) size (width - a number) by/x (height - a number):
        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;
        drscimage (ID) in (current graphics window) at (x1) by (y1) with dimensions (width) by (height).


    Include (-

    [DrawImageScaled ID win x y image_x image_y ;
        if (win.ref_number) {
            glk_image_draw_scaled(win.ref_number, ResourceIDsOfFigures-->ID, x, y, image_x, image_y);
        }
    ];

    -).