mdechatech / chartweener Goto Github PK
View Code? Open in Web Editor NEWUnity3D - Animate characters in text
License: MIT License
Unity3D - Animate characters in text
License: MIT License
Assets/CharTween/Scripts/VertexGradientPlugin.cs(14,18): error CS0534: `CharTween.VertexGradientPlugin' does not implement inherited abstract member `DG.Tweening.Plugins.Core.ABSTweenPlugin<TMPro.VertexGradient,TMPro.VertexGradient,DG.Tweening.Plugins.Options.NoOptions>.SetFrom(DG.Tweening.Core.TweenerCore<TMPro.VertexGradient,TMPro.VertexGradient,DG.Tweening.Plugins.Options.NoOptions>, TMPro.VertexGradient, bool)'
CharTweener.Properties
is lacking the Get/Set methods for managing the proxy transform's localPosition
s.
As far as I can see, this can easily be implemented with:
public Vector3 GetLocalPosition(int charIndex)
{
return proxyTransforms == null ? Vector3.zero : GetProxyTransform(charIndex).localPosition;
}
public void SetLocalPosition(int charIndex, Vector3 localPosition)
{
GetProxyTransform(charIndex).localPosition = localPosition;
_updateVerticesPending = true;
}
I've added it for me locally, but I guess it could be useful in the repo!
Would you be able to add a license file to the repository so I know what use is allowed and how to credit?
This method makes it pretty easy: https://stackoverflow.com/a/37895659 .
Thanks!!
My character animations are getting as far as the character I have in my text.
I'm even skipping the sprite character animation setup.
for (int i = 0; i < tweener.CharacterCount; i++)
{
TMP_CharacterInfo charInfo = textInfo.characterInfo[i];
if (charInfo.elementType == TMP_TextElementType.Sprite) {
Debug.LogWarning($"TMP_TextElementType.Sprite character");
continue;
}
// Character animation setup comes next...
}
I've found that if I edit the Text live in the Editor and delete the Sprite, the animations for all the characters suddenly start working.
Any tips?
Update 1
In fact, it looks like that is the case with all Rich Text Tags in my TextMeshPro label...
Update 2
I've discovered that in CharTweener::UpdateCharPositions()
There is a check which is skipping characters after a Sprite character...
for (var i = proxyTransformList.Count - 1; i >= 0; i--)
{
// ...
if (proxy.CharIndex >= characterCount)
continue;
// ...
}
Looks like proxy.CharIndex
is referencing the index of characters BEFORE Rich Text Tags are passed and characterCount uses the count AFTER Rich Text Tags are passed.
Calling DOFade()
for the second time after changing a TMP_Text's color properties (be it color
or vertexGradient
) will reset it to its former solid color. Is this a known behavior that needs to be locally adressed or I'm just missing something?
It works great, but only the first time after compilation. If i stop and start the game, the effect doesn't show.
I have the Project settings > Reload Domain disabled. Does this use any static variables that needs resetting?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.