[11.5] Can I puppet a channel that has nothing in it?
Although this has frequently been cited as a cause of trouble, it is
demonstrably possible to puppet an empty channel and fill it with a sprite
on the fly. How desirable or advisable it is to do this remains to be seen,
but in essence all that is required is that you supply as many of the
properties the sprite would normally acquire from the score as possible.
The type of sprite property seems especially important in this respect. Eg:
-- puppetizing a sprite with nothing in the score
on insertNonPuppet stageSprite, cstNum, where
-- first puppet the channel
puppetsprite stagesprite,true
-- set its properties
set the castNum of sprite stageSprite = cstNum
set the type of sprite stageSprite = 16
set the ink of sprite stageSprite = 0
set the foreColor of sprite stageSprite = 255
set the backColor of sprite stageSprite = 0
-- in this case we'll just place our new cast
-- and keep it at it's natural size, but in theory
-- we may want to adjust its rect
set the loc of sprite stageSprite = where
set the stretch of sprite stageSprite = false
-- update it
updatestage
end insertNonPuppet
[Thanks to Paul Farry <p.farry@cqu.edu.au> for demonstrating this technique.]