Graphical Window Sprites

version 1 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Part 3b - Sprite Drawing (for use without Graphic Links by Jeff Sheets)

    To draw the/-- active sprites:
        Let L be the list of display-active sprites;
        sort L in display-layer order;
        repeat with current-sprite running through L:
            let cur-sprite be sprite-identity 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;
            unless using the preloaded sprites option:
                let temp be the image-width of cur-sprite;
                change the sprite-width of the current-sprite to temp;
                let temp be the image-height of cur-sprite;
                change the sprite-height of the current-sprite to temp;
            let x-temp be the sprite-width of current-sprite as a fixed point number;
            let y-temp be the sprite-height of current-sprite as a fixed point number;
            let x-int be x-temp real times the window-scaling factor real times the sprite-scaling factor of the current-sprite as an integer;
            let y-int be y-temp real times the window-scaling factor real times the sprite-scaling factor of the current-sprite as an integer;
            draw sprite cur-sprite at coordinates x-coord and y-coord with dimensions x-int and y-int;