-
2 Mar 2011 4:22 PM #1
Component Size Animation detail?
Component Size Animation detail?
Hi,
I have a custom component which I need to do size animation,
I use the
me.animate(Ext.apply({
duration: 500,
easing: 'easeIn',
to: to
}, true));
which is the function from AbstractComponent.animate;
the animation works fine,
however, I am not able to track for the progressively size change during the animation; which I need that for another resize object listen to the the custom component,
I have read through the AbstractComponent.animate, it seems that it set the size to the final size and have no clue to get the progressively size change during the animation,
is there any way to retrieve the information on the size change during the animation??
Thanks
-
2 Mar 2011 4:43 PM #2Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,653
- Vote Rating
- 14
Firing tween events on every frame would be quite excessive. This would also not be possible with CSS3 animations as there is no tweening timers available via javascript. What you can do is use a keyframe which does fire an event at a percentage basis. Something like this:
Then add a listener to the first 'keyframe' event which passes which keyframe it's on. You can change the 50 to whatever percent you wish.Code:me.animate(Ext.apply({ duration: 500, easing: 'easeIn', keyframe: { 50: { opacity: 1 // Some dummy property that isn't going to change, but you get a keyframe event fired here, a blank object may work and I can look at supporting it just to get the keyframe event you want out here }, 100: { width: 100px } }, true));
-
3 Mar 2011 9:44 AM #3
thanks for the information.
and could you simply explain how to listen to the keyframe from the animate?
thanks
-
5 Mar 2011 10:34 PM #4
You should not really need tween events because you can specify dynamic:true in the animation config which will make the resize operate on the Component itself rather than its outer element.
So you can then hook into resize events which will fire on each frame when the frame handler executes and sets the size to its calculated value for its point on the timeline.
But what problem are you trying to solve?Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
6 Mar 2011 9:57 AM #5
what I want to do is while moving and resizing a container, an image inside will resize and adjust the position (to keep in the middle of container) with the container.
because the current ImageComponent cannot resize itself to the container, so what I write is to use the component contains a image tag and scale the image to fit and center into the component
Thank you,
-
6 Mar 2011 10:15 PM #6
Use a layout. This is what they are for: Sizing child Components.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
Similar Threads
-
List Component and Detail View
By Andrel in forum Sencha Touch 1.x: DiscussionReplies: 4Last Post: 22 Jun 2011, 12:22 AM -
[CLOSED]Component.onShow and Component.onHide overwrite the animation.after function
By dhawkins in forum Sencha Touch 1.x: BugsReplies: 1Last Post: 18 Aug 2010, 7:57 PM -
Handling Master-Detail-Detail displays with back button support
By robertj98 in forum Sencha Touch 1.x: DiscussionReplies: 5Last Post: 15 Jul 2010, 12:59 AM


Reply With Quote