How use Rakugo Variables
Rakugo Variables are called RkVar for short. They are global, and accessible from both RkScript and GDScript.
You can define var in RakuScript file, like this:
You can access it in any RakuScript:You can change already existing var:
Currently in RakuScript we can't do stuff like this:
For now thanks to new features in 2.2, we can workaround this using variable assignments:
In GDScript you can define RkVars like this:
You can access it in any RakuScript: You can change it: You can display text with RkVar using Label like this:expand Label
func update_text():
var life = Rakugo.get_variable("player.life")
text = "You have %d life points left" % life
# or one-line version:
text = Rakugo.replace_variables("You have <player.life> life points left")
sg_variable_changed
signal: