Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Axonn

Tween Two GlowFilters simultaneously

Recommended Posts

Hello everybody ::- ).

 

I'm trying to use TimelineLite to do some nice text animations. As part of my task, I need to change 2 GlowFilters which I applied on the TextFields. One GlowFilter is inner and the other is outer.

 

Now... the way I tween ONE GlowFilter, is like this:

 

_StoryTextsTimeline.append(TweenMax.to(text1, 2, { x: 100, scaleX: 1, scaleY: 1, glowFilter: { index: 0, blurX: 2, blurY: 2 } } ));

 

But then, how can I use the same glowFilter vars property in order to target my *second* GlowFilter on the same object? I can't specify glowFilter twice, nor can I specify two different indexes. I think that it would be wise to allow the glowFilter vars property to accept an ARRAY as well as a simple Object (like it is now). Whenever you see that you got an Array there, you for-each it and treat all its members as glowFilter instruction Objects.

 

Anyway, the only solution I found to this is to append another extra Tween with an offset of minus initial_tween_time. This way, the two tweens will launch simultaneously within the Timeline.

 

If there is any other way to achieve this, I'm all ears.

Link to comment
Share on other sites

Yep, this is possible using two separate tweens (as you said), and setting the 2nd one's overwrite special property to false. You don't need to append() with a negative offset, though - you can simply appendMultiple() and pass both tweens in directly.

 

I'm not a big fan of allowing special cases where the glowFilters object is an array because:

 

1) It confuses and complicates the API

 

2) It is already possible with the current implementation (albeit not as concise as your recommendation)

 

3) It would add kb to the file size and since you're the first person to ever request such a feature, I don't think this is nearly common enough to warrant making everyone pay the file size price for the feature, especially since you can already accomplish what you're after with the current API.

 

I'm not at all saying your idea is bad, though. I completely see why you'd make such a request. But I always have to be careful about feature bloat and the associated kb hike and performance degradation. If I keep adding little things like this, over time things can get pretty bloated and confusing. It is really important to me that the engine perform extremely well and remain relatively lightweight.

Link to comment
Share on other sites

I completely agree with you. If it's not used enough, definitely not worth the extra bytes! I'm sure it's not in the "kb" range but if you keep adding, yes, you will get into the kb range and then in the tens of kb range.

 

I used overwrite: 3 (CONCURRENT).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×