Changing hyperlink style
Posted: Mon Jan 13, 2014 10:47 pm
I tried fiddling around with styles a bit and tried to change the style in which hyperlinks appear. The code below works (mostly copied from the hyperlink example), but the hyperlink does not gain focus nor does clicking it do anything anymore. If I comment out the marked line (i.e., don't apply the new style), everything works fine but I changed nothing (of course).
My guess is that I am completely off-track and misunderstood something so badly that I just can't figure out the right way...
My guess is that I am completely off-track and misunderstood something so badly that I just can't figure out the right way...
Code: Select all
init python:
style.lexikon = Style(style.hyperlink_text)
style.lexikon.bold = True
style.lexikon.color = "#aaaaff"
style.lexikon.underline = False
lexikon = Character(None, window_yfill=True, window_xmargin=20,
window_ymargin=20, window_background=Solid((0, 0, 0, 192)))
def hyperlink_styler(target):
return style.lexikon
config.hyperlink_styler = hyperlink_styler # <----------- crucial line
label define_quine:
lexikon "Quine:\n\nA program that prints itself to its output."
return
# The game starts here.
label start:
"A game that instructs on how to make a game? Isn't that a sort of {a=define_quine}Quine{/a}?"
# ...
return