Grimmwerks, seb,

The problem is to avoid flickering when loading the next member. 
Grimmwerk's solution will not work because the old member is still in 
the sprite when you begin scaling, and the sprite is automatically 
redrawn when it's changed. What will happen is that the user sees the 
old image scale (flicker), and then the new member displayed.

Seb, our suggestion seems to work very well. I've never thought of 
using puppet... I think what I will have to remember is that the 
puppet function is not "obsolete" - all sprites become puppeted as 
soon as you change anything from Lingo. So in some cases you need to 
unpuppet them.

I still have to try it with video, but for bitmaps it is just what 
I've been wanting to achieve (with a LOT more effort). Thank you very 
much!

-A.


>Hi Andreas,
>
>
>>  But if I resize the sprite (using width or rect or whatever) and load
>>  new members into it, every image will be resized to the set sprite
>>  dimensions.
>>
>>  Compensating for this creates all kinds of flickering and
>>  inconssistent behavior for the end user. (See example* further down.)
>>
>>  Q: How do I reset the sprite so that it automatically adjusts to the
>>  size of its contents? (_Before_ displaying the contents, that is...)
>
>
>I've just tried the un-puppetization then re-puppetization of sprites quite
>successfully, like in the test script below. (caveat : with directToStage
>videos I don't know how this may work)
>
>The idea is to kept the loc of sprite, unpuppet it to ask him to forgot its
>lingo based property changes and re-puppet him immediately and set its new
>properties (bypassing this un/repuppetisation already makes me encounter
>unpredictable (at last not the ones I've predicted) results)
>hth,
>.seb
>
>
>-- test behavior
>
>----------------------------------------------------------------------
>---- SYSTEM HANDLERS ----                                     SYSTEM *
>on _____________________SYSTEM_HANDLERS_________________________ ()
>
>on beginSprite me
>   me.miReset()
>end
>
>on mouseUp me
>   myMember = sprite(me.spriteNum).member
>
>   case myMember.name of:
>     "bmp1":
>       me.miChange()
>     "bmp2":
>       me.miReset()
>   end case
>end
>
>
>----------------------------------------------------------------------
>---- PRIVATE METHODS ----                                    PRIVATE *
>on _____________________PRIVATE_METHODS___________________________()
>
>
>on miChange (me) -----------------------------------------------------
>   --                                                           PRIVATE
>   -- > mouseUp
>   -------
>
>   mySprite  = sprite(me.spriteNum)
>   myLoc     = mySprite.loc
>   newMember = member("bmp2")
>
>   -- restore default sprite settings
>   puppetSprite me.spriteNum, FALSE
>   puppetSprite me.spriteNum, TRUE
>
>   myW    = newMember.width /2
>   myH    = newMember.height/2
>   myRect = rect(myLoc[1]-myW,\
>                 myLoc[2]-myH,\
>                 myLoc[1]+myW,\
>                 myLoc[2]+myH)
>
>   mySprite.member = newMember
>   mySprite.rect   = myRect
>
>end -- miChange handler
>
>
>
>on miReset (me) ------------------------------------------------------
>   --                                                           PRIVATE
>   -- > mouseUp
>   -------
>
>   mySprite = sprite(me.spriteNum)
>   myLoc    = mySprite.loc
>   newMember = member("bmp1")
>
>   -- restore default sprite settings
>   puppetSprite me.spriteNum, FALSE
>   puppetSprite me.spriteNum, TRUE
>
>   myW    = newMember.width
>   myH    = newMember.height
>   myRect = rect(myLoc[1]-myW,\
>                 myLoc[2]-myH,\
>                 myLoc[1]+myW,\
>                 myLoc[2]+myH)
>
>   mySprite.member = newMember
>   mySprite.rect   = myRect
>
>end -- miReset handler
>
>on _____________________END_OF_OBJECT_____________________ ()
>on _______________________________________________________________()
>
>[To remove yourself from this list, or to change to digest mode, go 
>to http://www.penworks.com/lingo-l.cgi  To post messages to the 
>list, email [EMAIL PROTECTED]  (Problems, email 
>[EMAIL PROTECTED]). Lingo-L is for learning and helping with 
>programming Lingo.  Thanks!]

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to