You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Add GDScript template to RichTextEffect
This commit is contained in:
@@ -0,0 +1,17 @@
|
|||||||
|
# meta-description: Base template for rich text effects
|
||||||
|
|
||||||
|
@tool
|
||||||
|
class_name _CLASS_
|
||||||
|
extends _BASE_
|
||||||
|
|
||||||
|
|
||||||
|
# To use this effect:
|
||||||
|
# - Enable BBCode on a RichTextLabel.
|
||||||
|
# - Register this effect on the label.
|
||||||
|
# - Use [_CLASS_ param=2.0]hello[/_CLASS_] in text.
|
||||||
|
var bbcode := "_CLASS_"
|
||||||
|
|
||||||
|
|
||||||
|
func _process_custom_fx(char_fx: CharFXTransform) -> bool:
|
||||||
|
var param: float = char_fx.env.get("param", 1.0)
|
||||||
|
return true
|
||||||
@@ -73,9 +73,11 @@ Ref<Script> GDScriptLanguage::make_template(const String &p_template, const Stri
|
|||||||
.replace(": String", "")
|
.replace(": String", "")
|
||||||
.replace(": Array[String]", "")
|
.replace(": Array[String]", "")
|
||||||
.replace(": float", "")
|
.replace(": float", "")
|
||||||
|
.replace(": CharFXTransform", "")
|
||||||
.replace(":=", "=")
|
.replace(":=", "=")
|
||||||
.replace(" -> String", "")
|
.replace(" -> String", "")
|
||||||
.replace(" -> int", "")
|
.replace(" -> int", "")
|
||||||
|
.replace(" -> bool", "")
|
||||||
.replace(" -> void", "");
|
.replace(" -> void", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user