teebarjunk / godot-text_effects

Some RichTextLabel effects for use in the Godot game engine.
MIT License
159 stars 13 forks source link

Random Transform? #1

Open JBingrun opened 3 years ago

JBingrun commented 3 years ago

Hi, thanks for the demo project, it makes me more clear about how to play with RichTextEffect, really cool. Playing a while, I'm curious about is it possible to apply a random number for each character offset for just one time? It always changing like shaking all the time when I trying to do this. And also, how do you get a random character from a line?

Example like 2021-07-12 135120

ghost commented 2 years ago

Things shake if you use random numbers because _process_custom_fx runs continuously. You can't really get a random character from a line because the function runs constantly. You could generate something pseudorandom and use an if statement to check if char_fx.absolute_position == value.

I took a shot at your static shaken effect. What do you think?

shaken_sample

You can get it here: https://github.com/scribbler957/BBCode-Extensions