[SOLVED] Execute function on custom tags
Posted: Tue Dec 06, 2022 8:17 pm
I have read about custom_tags and how to use it.
But instead of styling the tagged text, i want to make a function work while clicking a tagged text, like what anchor / {a=}{/a} tag work.
From the example given in Custom Text Tags section, in Ren'Py Documentation, it just show how to use custom_tags for styling use.
I want to show modal screen contains information from argument of the tagged text.
for example :
While "eroge" clicked, it will pop modal screen showing the argument as content.
Sorry if the code above error, im not on my working pc right now.
But instead of styling the tagged text, i want to make a function work while clicking a tagged text, like what anchor / {a=}{/a} tag work.
From the example given in Custom Text Tags section, in Ren'Py Documentation, it just show how to use custom_tags for styling use.
I want to show modal screen contains information from argument of the tagged text.
for example :
Code: Select all
cimo "What? I can't believe you love {pop='It is a Japanese genre of erotic video game.'}eroge{/pop} so much."
Code: Select all
init python:
def popinfo(tag, argument, contents):
Show("alert",title=contents,text=argument)()
config.custom_text_tags["pop"] = popinfo
screen alert(title, text):
modal True
zorder 200
style_prefix "confirm"
add "gui/overlay/confirm.png"
frame:
vbox:
xalign .5
yalign .5
spacing 15
text "{size=30}[title]{/size}"
text "{size=15}[text]{/size}"
hbox:
xalign 0.5
textbutton "OK" action Hide("alert")