XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently 2017年 Sep 23日 06:40

All times are UTC - 8 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: 2017年 Sep 5日 06:09 
Offline
User avatar

Joined: 2013年 Jul 29日 09:13
Posts: 556
The following is the animation code that does the job to animate an object in a Yahoo widget. It sets a rotation on the cog object that takes 990 ms to complete and it uses the easeout animation.

Code:
    cogrotation = cogrotation + 32;
    a = new RotateAnimation(cog, cogrotation, 990, animator.kEaseOut); // define the animation
    animator.start(a);   //trigger the animation



Xwidget appears to support similar style animation, in fact the IDE allows you to determine a number of animations but in a graphical drop down selection. Using the IDE I selected an animation effect, a sinusoidal ease out. This was set accordingly using the switch animation.

Having made those changes if you check the main.xul and you will see the following has been defined for the object.

Code:
animation.dynamicEffect="5" animation.duration="1" alwaysForward="false" enabledAnimateChange="true"



However, when you try to rotate the object in jscript code using:

Code:
cog.RotateAngle  = cog.RotateAngle + 180;



You will find that the Xwidget rotator does not observe the previously defined animation and the wheel simply rotates 180 degrees with no sinusoidal ease out. So, in this case the rotateAngle property is simply equivalent to the Yahoo widget .rotate property. There is no animation and there is no way to trigger any animation.

However, if you bind a core to the rotator and select an appropriate tag you can see an animation triggered and in operation, working succesfully but the rotation is not one we require being tied specifically to the API of the core you have selected.

It seems that a core needs to be bound in order for any animation to occur, so the animation trigger is contained solely within the cores themselves and is not an effect you can bind to an object in any other way. I have no need to bind the rotator to any existing core as I have no need for any of the functions the cores provide and do not wish it to interface with any of the current core components. The requirement in this case is simply a rotating wheel that needs an animation on ease out, I don't want it to rotate back and forth in a random fashion bound to the CPU core, for example.

Fundamentally, if an animation is assigned to a rotator object then the animation should occur whenever the item is rotated. Instead of the rotation I have had to use a timer to spin the cog for a certain amount of time. To simulate the ease out animation I would have to add even more complex manual code and that is overkill so I have abandoned the idea. Instead I now have just a simple rotation controlled by a timer:

Code:
function spinCogsTimerOnUpdate(Sender)
{
    spinTimerCount = spinTimerCount + 1;
    cog.RotateAngle  = cog.RotateAngle + 20;

    if (spinTimerCount == 20) {
       spinCogsTimer.enabled = false;
       spinTimerCount = 0;
    }
}



With regard to Xwidget's capability most animations can be achieved but only in concert with one of Xwidget's cores. If the animation corresponds to a system activity that is provided by an Xwidget core then bind that core to a rotator object, set a corresponding tag and watch the rotator animate succesfully. If it is not a system activity that you want then your animation is scuppered and you'll have to abandon it.

Which brings us to the suggestion: Xwidgets to allow objects to be animated without being bound to a core. This would allow smooth rotations, movements without a core.


Top
 Profile  
 
PostPosted: 2017年 Sep 6日 04:05 
Offline
User avatar

Joined: 2013年 Jul 29日 09:13
Posts: 556
Jim, you added several suggestions to the buglist, this is just as valid as the others so can you please add this one. Thanks.


Top
 Profile  
 
PostPosted: 2017年 Sep 7日 21:30 
Offline
User avatar

Joined: 2012年 Dec 5日 17:52
Posts: 4545
I will... Thanks

_________________
Image
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
PostPosted: 2017年 Sep 8日 01:57 
Offline
User avatar

Joined: 2013年 Jul 29日 09:13
Posts: 556
Thankyou Jim.


Top
 Profile  
 
PostPosted: 2017年 Sep 8日 09:33 
Offline
User avatar

Joined: 2012年 Dec 5日 17:52
Posts: 4545
yereverluvinuncleber wrote:
Thankyou Jim.

Buglist updated.. :)

_________________
Image
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group