How to apply animation panel?

Theera

Well-Known Member
Licensed User
Longtime User
Hi everybody,
I downloaded example animation in library. I prefer click button5. I need apply my project about panel.Whenever I click my application's icon or whenever I logout my app,my app is shown like button5. My code is belows:

Sub Activity_Create(FirstTime As Boolean)
Dim ani As Animation
Activity.LoadLayout("Layout1")
PnelLayOut1.Visible=True
ani.InitializeScaleCenter("",0,0,PnelLayOut1.Height,PnelLayOut1.Width,PnelLayOut1) <---How to coding?

Best Regards
Theera:sign0163:
 
Last edited:

Theera

Well-Known Member
Licensed User
Longtime User
It should be:
B4X:
ani.InitializeScaleCenter("",0,0,1,1,PnelLayOut1)

I have coded programming,but It 's not slow motation expand
Best Regards
Theera:sign0013:
 
Upvote 0

cbal03

Member
Licensed User
Longtime User
I have coded programming,but It 's not slow motation expand
Best Regards
Theera:sign0013:

If the animation object's 'duration' param isn't set then the animation will be instant. i.e. no animation. To set this param you would write object.Duration = 1000. This is in milliseconds.

Best regards
 
Upvote 0

cbal03

Member
Licensed User
Longtime User
I want to InitializeScaleCenter a panel but when the animation is finished playing my panel returns to its original size. How do I gather the appropriate settings of the panel to force it to stay scaled in the AnimationEnd subroutine?

I've searched these forums and have experimented this entire day and can only prevent the movement type of animations from returning to their original position.

I have several more questions regarding the non moving (from x to y) animations.

How does the scale actually work? By this I mean that if I want to do:
thisAnim.InitializeScaleCenter("thisAnimationEndHandler", 1, 1, 10, 10, myPanel)

What are the ToX and ToY? Are they a multiple of the original dimmensions?
What happens to the original X and Y of the panel. Do they decrease as the panel grows larger?
Is there a way to capture these values as the panel animation plays?



Thanks in advance
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You should use the AnimationEnd event to set the size and position of the panel.
What are the ToX and ToY? Are they a multiple of the original dimmensions?
Yes.
What happens to the original X and Y of the panel. Do they decrease as the panel grows larger?
Yes.

Is there a way to capture these values as the panel animation plays?
No. However it shouldn't be too difficult to calculate the final values.
 
Upvote 0
Top