-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Idea: port some useful controls from min-shaping branch #14
Comments
All Godot controls can act as a container, for the buttons (and similar controls) you can always add Another option without porting controls (this will work as module, won't work as GDNative and essentially what was done in shaping PRs) is to add a wrapper for the new font system, most controls draw text by calling Here's test branch: https://github.com/bruvzg/godot_tl/tree/font_wrapper, but it requires tiny change to the core engine: diff --git a/scene/resources/font.h b/scene/resources/font.h
index 9b99b85d22..dcedc602ee 100644
--- a/scene/resources/font.h
+++ b/scene/resources/font.h
@@ -49,12 +49,12 @@ public:
virtual float get_descent() const = 0;
virtual Size2 get_char_size(CharType p_char, CharType p_next = 0) const = 0;
- Size2 get_string_size(const String &p_string) const;
+ virtual Size2 get_string_size(const String &p_string) const;
Size2 get_wordwrap_string_size(const String &p_string, float p_width) const;
virtual bool is_distance_field_hint() const = 0;
- void draw(RID p_canvas_item, const Point2 &p_pos, const String &p_text, const Color &p_modulate = Color(1, 1, 1), int p_clip_w = -1, const Color &p_outline_modulate = Color(1, 1, 1)) const;
+ virtual void draw(RID p_canvas_item, const Point2 &p_pos, const String &p_text, const Color &p_modulate = Color(1, 1, 1), int p_clip_w = -1, const Color &p_outline_modulate = Color(1, 1, 1)) const;
void draw_halign(RID p_canvas_item, const Point2 &p_pos, HAlign p_align, float p_width, const String &p_text, const Color &p_modulate = Color(1, 1, 1), const Color &p_outline_modulate = Color(1, 1, 1)) const;
virtual bool has_outline() const { return false; } This should work with everything except |
You are very productive, I'm speechless so I'm typing:) |
I tested font_wrapper branch and I got these errors when I want to set custom fonts but text rendered fine:
Maybe it's a good idea to mention this branch in README of project because I think using libgdtl as module with this patch is best option for someone that want support CTL languages in games. |
I think it's a good idea to port some useful controls from min-shaping branch to this repository. I really lost my hope that your incredible work finally merged even in Godot 4!
If we have a simple multi language game as demo we can identify which controls are most useful.
these are some controls that seems as good candidate to port:
The text was updated successfully, but these errors were encountered: