Show and Hide Tutorial¶
This tutorial will show you how to use
hide() funcs in Dialogue.
Updated for Rakugo 3.1.0
First we need add to our scene something that we can show or hide. In can be any type of node, if we set and script it correct.
In this example we will use this free character sprite.
Open your Rakugo project then move folder with sprites to game/characters (if you don’t have this folder create it).
After that godot will start importing this assets.
When godot finish importing click on plus icon to create new scene.
For my case we choose 2D Scene as scene type.
Now change root Node name to character name, we will call mine Yui.
Then we change name of asset folder to reflect that.
Now we save scene to game/characters/Yui as Yui.tscn.
After that we select all assets and drag them in to scene.
Add character sprite to our dialogue scene¶
First save our scene and add it to our dialogue scene so we can test this.
showable tag allow us to use it already in dialogue scene in dialogue script
hide() in dialogue script, because any Node2D has
hide() in it.
Define Yui character in
Rakugo.define_character("Yui", "yui", Color.pink)
Then add this lines to our dialogue:
say("yui", "Hi, I'm Yui.") show("yui happy") step() say("yui", "I'm must go.") hide("yui") step()
And we get happy Yui.
She hide in next step of dialogue