Glimmr Drawing Commands

version 2/101030 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - Long forms of tileset image map (no background)

    To drimagemap in (WIN - a g-window) at (X1 - a number) by/x (Y1 - a number) using (IMG_MAP - a list of lists of numbers) rendered/-- using/with/by (TSET - a tileset) with tile-size (W - a number) by/x (H - a number) --/pixel/pixels/px:
        let row be Y1;
        let column be X1;
        repeat with current-row running through IMG_MAP:
            repeat with index running through current-row:
                if index > 0:
                    if there is a char of index in the translation-table of TSET:
                        choose row with a char of index in the translation-table of TSET;
                        [now current tile is the tile entry;]
                        drscimage (tile entry) in (WIN) at (column) by (row) with dimensions (W) by (H);
                increase column by W;
            increase row by H;
            now column is X1.

    To draw/display an/-- image-map in (WIN - a g-window) at (X1 - a number) by/x (Y1 - a number) using (IMG_MAP - a list of lists of numbers) rendered/-- using/with/by (TSET - a tileset) with tile-size (W - a number) by/x (H - a number) --/pixel/pixels/px:
        #if utilizing Glimmr debugging;
        let total-height be the number of entries of IMG_MAP;
        let WDT be the the number of entries in entry 1 of IMG_MAP;
        say "[>console][DC]Image-map drawn at screen coordinates ([X1], [Y1]) of [WIN] using the list of numbers provided, interpreted as a grid [WDT] tiles wide and [total-height] tiles high. Tile size used: [W] by [H] pixels.[<]";
        #end if;
        drimagemap in (WIN) at (X1) by (Y1) using (IMG_MAP) rendered with (TSET) with tile-size (W) by (H).
        
    To draw/display an/-- image-map in (WIN - a g-window) at (COORD1 - a list of numbers) using (IMG_MAP - a list of lists of numbers) rendered/-- using/with/by (TSET - a tileset) with tile-size (W - a number) by/x (H - a number) pixel/pixels/px/--:
        let X1 be entry 1 of coord1;
        let Y1 be entry 2 of coord1;
        display an image-map in (current graphics window) at (X1) by (Y1) using (IMG_MAP) rendered using (TSET) with tile-size (W) by (H).