Graphical Window Sprites

version 1 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Part 8 - Debugging commands (for use without Permanent Debugging by Erik Temple)

    Chapter 8.1 - Debugging Sprites (not for release)

    Debugging sprites is an action out of world. Understand "sprite tracing" and "sprites" and "sprite-tracing" as debugging sprites. Sprite-trace is a truth state that varies. Sprite-trace is false.

    Check debugging sprites:
        If sprite-trace is false:
            now sprite-trace is true;
        otherwise:
            now sprite-trace is false;
        say "Sprite tracing now [if sprite-trace is true]on. All images are currently scaled at [window-scaling factor] to fit in the window[otherwise]off[end if].[line break]";
        if sprite-trace is true, follow the sprite tracing rule.

    Every turn when sprite-trace is true (this is the sprite tracing rule):
        let L be the list of display-active sprites;
        sort L in reverse display-layer order;
        let last layer be the display-layer of entry 1 of L;
        say "LAYER [last layer]:[line break]";
        repeat with current-sprite running through L:
            if display-layer of current-sprite is not last layer:
                say "LAYER [display-layer of current-sprite]:[line break]";
                now last layer is the display-layer of current-sprite;
            let x-temp be entry 1 of the sprite-coordinates of the current-sprite scaled by the window-scaling factor;
            let y-temp be entry 2 of the sprite-coordinates of the current-sprite scaled by the window-scaling factor;
            let x-coord be x-temp real plus window x-offset as an integer;
            let y-coord be y-temp real plus window y-offset as an integer;
            say " [current-sprite] ([sprite-identity of current-sprite]: [sprite-width of current-sprite] x [sprite-height of current-sprite] pixels): ([entry 1 of sprite-coordinates of current-sprite],[entry 2 of sprite-coordinates of current-sprite]); local scaling ratio [sprite-scaling factor of current-sprite][if current-sprite is graphlink-active]; graphlinked[end if].";
        if grid-background is false:
            say "BACKGROUND IMAGE:[line break] [currently shown picture], currently presented at [background-width] x [background-height] pixels (ratio of [window-scaling factor]).";
        otherwise:
            say "GRID-BACKGROUND:[line break] [grid-x] x [grid-y], currently presented at [background-width] x [background-height] pixels (ratio of [window-scaling factor]).";
        say "CURRENTLY SHOWN PICTURE / INTERNALLY SELECTED PICTURE (see Simple Graphical Window):[line break] [currently shown picture] / [internally selected picture]."