Glimmr Canvas Editor

version 1/100805 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Part - Define dynamic sprites

    [Because Inform lacks multiple inheritance, we need to create a full system of kinds parallel to those usable with Canvas-Based Drawing. We define most of the properties with the dynamic-sprite, and then apply them later to other classes. A parallel effect could probably be achieved with properties (and it likely should have been done that way), but I was never satisfied with methods that didn't use kinds--so we have this unwieldy system...]

    A thing can be either real or legerdemained. A thing is usually real.

    Definition: A g-element is in-play:
        if it is standard, yes;
        if it is instanced, yes;
        no.

    A dynamic-sprite is a kind of sprite. The associated canvas of a dynamic-sprite is the library-canvas.

    A dynamic-sprite has an indexed text called the element-name. The element-name is usually "".

    A dynamic-sprite has a number called the instance-counter. The instance-counter is usually 0.

    A dynamic-sprite can be deleted, standard, instanced, or parental. A dynamic-sprite is usually parental.

    A dynamic-sprite has some text called the kind-flag. The kind-flag of a dynamic-sprite is "sprite".
    A dynamic-sprite has some indexed text called the of-kind.

    A dynamic-sprite has a number called the kind-index. The kind-index is 0. [This is part of an elaborate workaround for a bug with list-sorting in 5Z71, whereby lists cannot be sorted on indexed text properties. The bug was fixed in 6Exx, but I didn't have the gumption to change everything back...]

    A dynamic-sprite has some indexed text called the replacement-command. The replacement-command is "".

    A dynamic-sprite has a figure name called the image-ID. The image-ID is usually Figure of Error.

    A dynamic-sprite has some indexed text called the tag.

    A dynamic-sprite has a number called the sprite-x. The sprite-x is 0.
    A dynamic-sprite has a number called the sprite-y. The sprite-y is 0.