String maskPool = "0123456789";
TextMutation mutation = new TextMutation("My Text", maskPool);
mutation.setFactor(0.8f);
mutation.update(1f);
String mutatedText = mutation.get();
mutation.setFactor(0.1f);
mutation.update(1f);
mutatedText = mutation.get();
// Also possible via tweening
Tween.to(mutation, TextMutationTween.FACTOR, 2f)
.target(0f)
.start(...);
For example, the following text "Hello World" and the following mask "123" with a factor of 0.5 would replace 50% of the characters (at random, except white spaces) "H1ll3 2or12"
Add possibility to mutate text:
For example, the following text
"Hello World"
and the following mask"123"
with a factor of0.5
would replace 50% of the characters (at random, except white spaces)"H1ll3 2or12"