airbnb / lottie-web

Render After Effects animations natively on Web, Android and iOS, and React Native. http://airbnb.io/lottie/
MIT License
30.54k stars 2.87k forks source link

Text Box with multiple text colour #1226

Open aakey7 opened 6 years ago

aakey7 commented 6 years ago

I have a text box that wil be using dynamic text and also TextLayer.canResizeFont. Is it possible to change the colour of a certain word in that text box?

Or would i have to create multiple text boxes to achieve this?

Danjuanlab commented 6 years ago

You need to split your sentence into words in AE, then rename the layer you want to change color or other attributes to "#name". When you generate svg on the web, you will see the text you want to change have an ID="name", then you can use jquery or JS to select this element and make changes to its properties.

aakey7 commented 6 years ago

So if we are trying to use dynamic text, there is no way of selecting a specific word unless we know the correct amount of words prior?

On Sun, Sep 2, 2018 at 12:51 AM Danjuanlab notifications@github.com wrote:

You need to split your sentence into words in AE, then rename the layer you want to change color or other attributes to "#name". When you generate svg on the web, you will see the text you want to change have an ID="name", then you can use jquery or JS to select this element and make changes to its properties.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/airbnb/lottie-web/issues/1226#issuecomment-417895169, or mute the thread https://github.com/notifications/unsubscribe-auth/ALSnye1fF2x41XHv0nGk4iFt8VNdTQvIks5uWx10gaJpZM4WWO0Y .

Danjuanlab commented 6 years ago

As far as i know,the dynamic text function only support to change the text content.If you want change the text fill color,The way I talked before is the most convenient solution I know at present.updateDocumentData