Glimmr Canvas Editor

version 1/100805 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter - The mother-sprite

    The mother-sprite is a dynamic-sprite. The image-ID is Figure of Error. The element-name is "Error_1". The origin is {10, 0}. The display status is g-inactive. The graphlink status is g-active. The linked replacement-command is "". The x-scaling factor is 1.0000. The y-scaling factor is 1.0000.[The mother-sprite is in Fake-room_x.]

    Current_row is a number that varies. Current_row is 0.

    To initialize the/-- dynamic sprites:
        let L be the list of figure names;
        repeat with current-sprite running through L:
            if the resource number of current-sprite is greater than the built-in resources index:
                create a new sprite from mother-sprite using current-sprite.
            
    To decide which number is the resource number of (F - a figure name):
        (- ResourceIDsOfFigures-->{F} -)

    To create a new sprite from (S - a g-element) using (F - a figure name):
        let the new sprite be a new object cloned from S;
        change the image-ID of the new sprite to F;
        change the display status of new sprite to g-active;
        unlink the element-name of the new sprite;
        change the element-name of the new sprite to "[F]" stripped of "Figure of " concatenated with the instance-counter of S;
        replace the text " " in the element-name of the new sprite with "_";
        change the x-scaling factor of the new sprite to 1.0000;
        change the y-scaling factor of the new sprite to 1.0000;
        unlink the origin of the new sprite;
        unlink the tag of the new sprite;
        change entry 2 of the origin of the new sprite to current_row plus 8;
        let vertical-offset be the image-height of the image-ID of the new sprite;
        increase the current_row by the vertical-offset;
        if using the logged sprite creation option, say "New sprite [element-name of new sprite] created from [image-ID of new sprite].";

    To decide which indexed text is (T - indexed text) concatenated with (N - a number):
        decide on "[T]_[N]".
        
    To decide which indexed text is (T - indexed text) stripped of (R - indexed text):
        replace the text R in T with "";
        decide on "[T]".
        
    To unlink (P - property) of (O - object):
        (- DO_UnlinkProp({P}, {O}); -). [see Dynamic Objects for the definition of this routine]

    To say objUID of (O - an object):
        (- print {O}; -)