[30 Mar 2010] Bug in MoveAnim/PlayAnim

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
nexus
Posts: 150
Joined: Sun Mar 07, 2010 11:54 am

[30 Mar 2010] Bug in MoveAnim/PlayAnim

Post by nexus »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 30 Mar 2010 05:55:02 -0000

Hm. My last email seems not to have reached this list. So, one more try.

The following Code does some weird thing.First, the GIF-anim is correctly moved, but then after a short distence, the TextOut-Layer jumps to the position where the gif-anim is, and then is moved instead to the gif-anim.

if i comment the line:

Code: Select all

Local animHandle = PlayAnim(id,100,100,{times=0,Async=True})
the GIF-anim movement works correctly, although, "animHandle" isn't used at all in the example below.

Actually, what i tried to do (or tried to learn how to do it) is, to permanently have a GIF-Anim running which i then move from one position to another (not yet known) position as soon as some certain event occurs.

Let me know, how you would do that :-) (PS: Meanwhile, i've found the NextFrame()-function in the Layers section, which is quiet handy for this job, although I would have expected to find it in the animation section ;-) )

regards, Tom

Code: Select all

    Function p_play2(msg)
    
              If (AsyncDrawFrame(msg.userdata.handle))
                  ClearInterval(msg.userdata.intid)
              EndIf
    
    EndFunction
    
    TextOut(200, 200, "some text", {name="sometext"})
    
    Local path = FullPath(#DEFPICSDIR, "some.gif")
    Local id = LoadAnim(nil,path,{Transparency=#WHITE})
    
    Local animHandle = PlayAnim(id,100,100,{times=0,Async=True})
    Local moveHandle = MoveAnim(id,100,100,500,400,{Async=True})
    
    SetInterval(1,p_play2,40,{handle=moveHandle,intid=1})
    
    Repeat
      WaitEvent
    Forever
User avatar
airsoftsoftwair
Posts: 5830
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[31 Mar 2010] Re: Bug in MoveAnim/PlayAnim

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 31 Mar 2010 12:55:49 +0200
Hm. My last email seems not to have reached this list. So, one more try.

---------------------

The following Code does some weird thing.First, the GIF-anim is correctly moved, but then after a short distence, the TextOut-Layer jumps to the position where the gif-anim is, and then is moved instead to the gif-anim.

if i comment the line:

Local animHandle = PlayAnim(id,100,100,{times=0,Async=True})

the GIF-anim movement works correctly, although, "animHandle" isn't used at all in the example below.
Well, assigning two asynchronous draw handles to the same layer is asking for trouble :) That is currently not supported. A layer must only have one asynchronous draw handle attached.

But for your purposes, NextFrame() should be the best solution because it allows you to change the frame as well as the position of an anim layer. Of course, you could also use SetLayerStyle() for the ultimate control.
Locked