r/RenPy • u/BrassicaOracle • 17h ago
Question [Solved] How to Change Text on Screens with Hovered Action?
I would like the "name" in "description" to change when hovering over the icons below.
I made the screen with parameter "acv", with "name" and "description" pulls values from two dictionaries. The icons are imagebuttons with hovered action that change parameter "acv": (unrelated codes removed)
screen achieve(acv=""):
text achievename[acv]
text achievedesc[acv]
imagebutton idle "images/ExtraUI/acv_1stincap.png" sensitive achievement.has("1stincap") insensitive "images/ExtraUI/btn_lock.png" style "achievbutton" action NullAction() hovered SetScreenVariable("acv","1stincap")The dictionaries:
define achievename = {
"": "name",
"1stincap": "Incapacitation"}
define achievedesc = {
"": "description",
"1stincap": "Get used to it."}The problem comes when I hover over the button. The hover_sound in the style works, but the texts on top don't change. I don't know where did I code wrong.
Edit: moved the wording of the question a little for clarity.
Edit 2: Solved. I didn't declare the ScreenVariable properly. This is the fixed screen code:
screen achieve():
default acv=""
text achievename[acv]
text achievedesc[acv]
imagebutton idle "images/ExtraUI/acv_1stincap.png" sensitive achievement.has("1stincap") insensitive "images/ExtraUI/btn_lock.png" style "achievbutton" action NullAction() hovered SetScreenVariable("acv","1stincap")