2022-05-16 23:48:22 +00:00
|
|
|
screen tooltip():
|
|
|
|
layer "interface"
|
|
|
|
tag tooltip
|
|
|
|
zorder 5
|
|
|
|
style_prefix "tooltip"
|
|
|
|
|
2022-05-31 15:03:20 +00:00
|
|
|
$ tooltip = GetTooltip()
|
|
|
|
|
|
|
|
if settings.get("tooltip") and tooltip:
|
|
|
|
window:
|
|
|
|
id tooltip
|
|
|
|
at tooltip_follow
|
|
|
|
text "[tooltip]"
|
2022-05-16 23:48:22 +00:00
|
|
|
|
|
|
|
style tooltip_window is empty:
|
|
|
|
background "#00000080"
|
|
|
|
padding (12, 6)
|
|
|
|
xmaximum 300
|
|
|
|
|
|
|
|
style tooltip_text is default:
|
|
|
|
color "#fff"
|
|
|
|
size 10
|
|
|
|
outlines [(1, "#00000080", 1, 0)]
|
|
|
|
|
2022-05-31 15:03:20 +00:00
|
|
|
transform tooltip_follow:
|
|
|
|
events False
|
|
|
|
function tooltip_func
|
2022-05-16 23:48:22 +00:00
|
|
|
|
2022-05-31 15:03:20 +00:00
|
|
|
init python:
|
2022-05-16 23:48:22 +00:00
|
|
|
|
2022-05-31 15:03:20 +00:00
|
|
|
def tooltip_func(trans, st, at):
|
|
|
|
x, y = renpy.get_mouse_pos()
|
|
|
|
xanchor = 1.0 if (x > 980) else 0.0
|
|
|
|
yanchor = 1.0 if (y > 500) else 0.0
|
|
|
|
xoffset = 11 if xanchor else 0
|
|
|
|
yoffset = 14 if yanchor else 0
|
|
|
|
trans.pos = (x, y)
|
|
|
|
trans.anchor = (xanchor, yanchor)
|
|
|
|
trans.offset = (xoffset, yoffset)
|
|
|
|
|
|
|
|
return 0
|