I'm sorry I'm so newbie and I'm developing while learning a game about solving riddles
I'm trying to use a RichTextLabel using bbcode text and update the text while the label is visible
func _input(event):
if event is InputEventKey and event.pressed:
if visible == true && _harry == "riddle" && event.scancode == KEY_UP:
print("key_up")
print(option)
option += 1
if visible == true && _harry == "riddle" && event.scancode == KEY_DOWN:
print("key_down")
print(option)
option -= 1
if event.scancode == KEY_ENTER && _harry == "met":
visible = false
_harry = "riddle"
if event.scancode == KEY_ENTER:
visible = false
if option > 3 :
option = 1
if option < 1 :
option = 3
func updateText():
_text.bbcode_text = textToUpdate
func on_GameMap_cell_id(cell_id):
print(cell_id)
if cell_id == 1 :
text.bbcode_text = "This is a 'broken ladder' sign, parts of which are missing. One end somehow got caught on the branch of the tree, leaving the other end of the ladder with only a few rungs. So you can't escape..."
visible = true
if cell_id == 3 and harry == "new" :
text.bbcode_text = "Don’t worry about whether or not you have enough money for a surgeon; Odds are, you don’t. One way to find wealth is to make your ghost friends rich wealth fortunes... The affluent greed bollocks."
visible = true
_harry = "met"
if cell_id == 3 and _harry == "riddle" :
if option == 1 :
textToUpdate = "I have keys but not locks. I have space, but not room. You can enter, but you can't leave... [color=green]Think[/color] Answer Leave"
updateText()
if option == 2 :
textToUpdate = "I have keys but not locks. I have space, but not room. You can enter, but you can't leave... Think [color=green]Answer[/color] Leave"
updateText()
if option == 3 :
textToUpdate = "I have keys but not locks. I have space, but not room. You can enter, but you can't leave... Think Answer [color=green]Leave[/color]"
updateText()
visible = true
