bradley / Blotter

A JavaScript API for drawing unconventional text effects on the web.
https://blotter.js.org
Other
3.05k stars 209 forks source link

Animation resets when text changes #56

Closed gonzam88 closed 3 years ago

gonzam88 commented 4 years ago

I'm using LiquidDistortMaterial for a text, and whenever I change the content, the animation restarts making it very unpleasent. Is there any workaround to avoid this reset? Maybe an offset animation start parameter?

This is my normal text changing code blotterText.value = text; blotterText.needsUpdate = true;

bradley commented 3 years ago

Sorry for the late reply. If youre still having this issue, can you share a fiddle recreating the issue? I have a strong feeling it wont be fixable due to how Blotter maps texts for each effect into textures (essentially, needsUpdate triggers this to re-map) but maybe there is something easily fixed in your own use case. Another option for this kind of thing, but that is a bit of a hack, may be to add all the texts youre expecting to iterate over (during your "change" event) and use the individual text scopes to replace eachother on screen when you want the swap to occur. However, if youre trying to make it work with like keyboard input or something, I have a feeling Blotter may not be the right solution as-is.

gonzam88 commented 3 years ago

Thanks for clearing that. Exactly, it was for a countdown, and looked for a less fancy display :)