teebarjunk / godot-text_effects

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

Version for Godot 4 #2

Open naturally-intelligent opened 1 year ago

naturally-intelligent commented 1 year ago

Hi - I really like your library!

My request is to have version for Godot 4 Probably need new repo?

cheers

naturally-intelligent commented 1 year ago

Most of the base effects can be upgraded by changing

.character to .glyph_index

They've removed "absolute_index" but I haven't had a problem after changing those references to "relative_index"

SimonGigant commented 9 months ago

Hey. I just discovered this library and loved it, it's really convenient.

Because the code was not compatible with Godot 4.0 I made my own changes to make it work in a few hours.

You can find them here: https://github.com/SimonGigant/godot-text_effects_4.0

It was a bit harder to do than only changing a few keywords. They made significant changes on how character index are stored in CharFXTransform. I fixed it quickly and I think there is better and more optimized ways to do it. Because of how the glyph_index is now dependent on the chosen font, I had to make a few conversions between different paradigms, in runtime, and it's not the cleanest thing. I did not try with non latin character, it could work differently, as I converted glyphs using unicode index.

TL;DR that's not perfect but it works