Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 11 total
Thread Another animation question
Sun, Sep 4 2016 2:51 PMPermanent Link

Richard Mace

Hi All,

I have 3 labels on a form, laid out as follows:

                                         Label 1

                                         Label 2

                                         Label 3

I can get the first one to animate in from the left no problem, but the effect I am wanting to achieve is that label 1 animates from the left, whilst Label 2 and 3 are both not visible. Then, after Label 1 has finished animating, Label 2 is then visible and starts it's animation from the left, then when 2 has finished, label 3 animates from the left as well.

Any tips on how I can accomplish this please, as all I can currently achieve, is for all 3 labels to be visible at once and animate on from the left.

Richard
Sun, Sep 4 2016 4:49 PMPermanent Link

erickengelke

Avatar

>I can get the first one to animate in from the left no problem, but the effect I am wanting to achieve is that label 1 animates from the left, whilst Label 2 and 3 are both not visible. Then, after Label 1 has finished animating, Label 2 is then visible and starts it's animation from the left, then when 2 has finished, label 3 animates from the left as well.

Use onAnimationComplete from the first label to start the visible := True on the 2nd, and chain them that way.

Erick
Sun, Sep 4 2016 5:20 PMPermanent Link

Richard Mace

erickengelke wrote:

>> Use onAnimationComplete from the first label to start the visible := True on the 2nd, and chain them that way.

>> Erick

Erick,
Thanks for your reply.

I did try that before I posted the question actually, however, as soon as I set the 2nd labels property to visible, it's almost completed it's animation, that is, as soon as it's visible, the animation seems to be completed.

It's almost like the animation is happening even though the component is not visible? Unless, I am not understanding something, which is highly likely Smile

Richard
Mon, Sep 5 2016 4:11 AMPermanent Link

Matthew Jones

Richard wrote:

> It's almost like the animation is happening even though the component
> is not visible? Unless, I am not understanding something, which is
> highly likely Smile

Animations you set up in the IDE at design time happen immediately the
form is created. If you want them to happen later, you need to manually
set them up and trigger them. So have the first one done in the IDE,
and then set the others up in the OnAnimationComplete event. If you use
tags or other identifiers, you could use the same event for all.


--

Matthew Jones
Mon, Sep 5 2016 3:03 PMPermanent Link

Richard Mace

"Matthew Jones" wrote:

<< Animations you set up in the IDE at design time happen immediately the
form is created. If you want them to happen later, you need to manually
set them up and trigger them. So have the first one done in the IDE,
and then set the others up in the OnAnimationComplete event. If you use
tags or other identifiers, you could use the same event for all.>>

Thanks Matthew, I thought that was the answer then, but have put the following code in the first's label OnAnimationComplete event, and it still doesn't animate?

 lblHomeP2.Animations.Left.Duration := 1000;
 lblHomeP2.Animations.Left.Style    := asExpoEaseIn;
 lblHomeP2.Visible := True;
 
Does that look correct?

Richard
Tue, Sep 6 2016 3:46 AMPermanent Link

Matthew Jones

Richard wrote:

>   lblHomeP2.Animations.Left.Duration := 1000;
>   lblHomeP2.Animations.Left.Style    := asExpoEaseIn;
>   lblHomeP2.Visible := True;
>   
> Does that look correct?

No. You have set up the animation for "Left" and then made it visible.
You need to change the Left property to animate it.

Also worth saying that Visible is probably the least interesting
animation I think, as you really want the Opacity to make it "fade in".

Have a look at the animation sample in EWB samples for detailed info.

--

Matthew Jones
Tue, Sep 6 2016 7:58 AMPermanent Link

Richard Mace

>>   lblHomeP2.Animations.Left.Duration := 1000;
>>   lblHomeP2.Animations.Left.Style    := asExpoEaseIn;
>>   lblHomeP2.Visible := True;
>>   
>> Does that look correct?

> No. You have set up the animation for "Left" and then made it visible.
> You need to change the Left property to animate it.

> Also worth saying that Visible is probably the least interesting
> animation I think, as you really want the Opacity to make it "fade in".

> Have a look at the animation sample in EWB samples for detailed info.

I have setup the positioning via the layout property (position top left) so are you saying that if I was to set the layout property position in code, that would be enough to trigger it?

Richard
Tue, Sep 6 2016 8:09 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< Also worth saying that Visible is probably the least interesting animation I think, as you really want the Opacity to make it "fade in". >>

EWB handles that for you - check out the WebUI unit for details on how it does this with the Opacity.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Sep 6 2016 8:11 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Richard,

<< I have setup the positioning via the layout property (position top left) >>

That's the problem - you can't have layout positioning set for a control *and* animate its position.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Sep 6 2016 8:19 AMPermanent Link

Richard Mace

<< I have setup the positioning via the layout property (position top left) >>

< That's the problem - you can't have layout positioning set for a control *and* animate its position.

That's strange as the first label also has the same position (at design time) and that seems to work?

Richard
Page 1 of 2Next Page »
Jump to Page:  1 2
Image