diff options
Diffstat (limited to 'scene/gui/rich_text_effect.h')
-rw-r--r-- | scene/gui/rich_text_effect.h | 62 |
1 files changed, 40 insertions, 22 deletions
diff --git a/scene/gui/rich_text_effect.h b/scene/gui/rich_text_effect.h index f2e2823eff..5681f9b193 100644 --- a/scene/gui/rich_text_effect.h +++ b/scene/gui/rich_text_effect.h @@ -32,23 +32,11 @@ #define RICH_TEXT_EFFECT_H #include "core/io/resource.h" +#include "core/object/gdvirtual.gen.inc" +#include "core/object/script_language.h" -class RichTextEffect : public Resource { - GDCLASS(RichTextEffect, Resource); - OBJ_SAVE_TYPE(RichTextEffect); - -protected: - static void _bind_methods(); - -public: - Variant get_bbcode() const; - bool _process_effect_impl(Ref<class CharFXTransform> p_cfx); - - RichTextEffect(); -}; - -class CharFXTransform : public Reference { - GDCLASS(CharFXTransform, Reference); +class CharFXTransform : public RefCounted { + GDCLASS(CharFXTransform, RefCounted); protected: static void _bind_methods(); @@ -59,9 +47,11 @@ public: bool outline = false; Point2 offset; Color color; - float elapsed_time = 0.0f; + double elapsed_time = 0.0f; Dictionary environment; - uint32_t glpyh_index = 0; + uint32_t glyph_index = 0; + uint16_t glyph_flags = 0; + uint8_t glyph_count = 0; RID font; CharFXTransform(); @@ -69,19 +59,31 @@ public: Vector2i get_range() { return range; } void set_range(const Vector2i &p_range) { range = p_range; } - float get_elapsed_time() { return elapsed_time; } - void set_elapsed_time(float p_elapsed_time) { elapsed_time = p_elapsed_time; } + + double get_elapsed_time() { return elapsed_time; } + void set_elapsed_time(double p_elapsed_time) { elapsed_time = p_elapsed_time; } + bool is_visible() { return visibility; } void set_visibility(bool p_visibility) { visibility = p_visibility; } + bool is_outline() { return outline; } void set_outline(bool p_outline) { outline = p_outline; } + Point2 get_offset() { return offset; } void set_offset(Point2 p_offset) { offset = p_offset; } + Color get_color() { return color; } void set_color(Color p_color) { color = p_color; } - uint32_t get_glyph_index() const { return glpyh_index; }; - void set_glyph_index(uint32_t p_glpyh_index) { glpyh_index = p_glpyh_index; }; + uint32_t get_glyph_index() const { return glyph_index; }; + void set_glyph_index(uint32_t p_glyph_index) { glyph_index = p_glyph_index; }; + + uint16_t get_glyph_flags() const { return glyph_index; }; + void set_glyph_flags(uint16_t p_glyph_flags) { glyph_flags = p_glyph_flags; }; + + uint8_t get_glyph_count() const { return glyph_count; }; + void set_glyph_count(uint8_t p_glyph_count) { glyph_count = p_glyph_count; }; + RID get_font() const { return font; }; void set_font(RID p_font) { font = p_font; }; @@ -89,4 +91,20 @@ public: void set_environment(Dictionary p_environment) { environment = p_environment; } }; +class RichTextEffect : public Resource { + GDCLASS(RichTextEffect, Resource); + OBJ_SAVE_TYPE(RichTextEffect); + +protected: + static void _bind_methods(); + + GDVIRTUAL1RC(bool, _process_custom_fx, Ref<CharFXTransform>) + +public: + Variant get_bbcode() const; + bool _process_effect_impl(Ref<class CharFXTransform> p_cfx); + + RichTextEffect(); +}; + #endif // RICH_TEXT_EFFECT_H |