Preferences imagemap selection/testing preference variables

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
computistxyz
Regular
Posts: 58
Joined: Thu Jul 10, 2014 8:35 am
Github: sjgriffiths
Location: Coventry/Norwich, UK
Contact:

Preferences imagemap selection/testing preference variables

#1 Post by computistxyz »

So I've got a preferences imagemap menu something along the lines of:

Code: Select all

ground "graphics/gui/system/Pref_ground.png"
hover "graphics/gui/system/Pref_hover.png"
selected_idle "graphics/gui/system/Pref_sel_idle.png"
      
hotspot (1330, 479, 68, 43) action Preference("display", "fullscreen")
hotspot (1528, 479, 68, 43) action Preference("display", "window")
...wherein those two hotspots are 'Fullscreen' and 'Windowed' buttons respectively. When in fullscreen mode, the selected graphic displays correctly for the former button, but when the other is clicked to change to windowed mode (which works fine) it doesn't seem to detect that the variable is changed is such a way that the latter button should display the 'selected' graphic. This seems odd considering the former button works fine, in addition to the custom SetVariable preferences used with other buttons.

Is this some known weird graphical behaviour due to the display mode change? Or, is there a way to access the preferences as actual variables and perform Boolean tests to force the correct selected button graphic?

User avatar
GreyWolfXx
Regular
Posts: 68
Joined: Fri Jun 05, 2015 1:00 am
IRC Nick: Grey
Skype: GreyWolfXxII
Contact:

Re: Preferences imagemap selection/testing preference variab

#2 Post by GreyWolfXx »

I'm not sure if this completely answers your question, but I've noticed that when I program menus the "windowed" button is only checked off/ marked when I press fullscreen and then go back to windowed mode. I've noticed this in professional games as well -- games that I'm fairly sure are not in Ren'Py. If that's what you meant then this is a fairly common thing.

"We have been to the moon, we have charted the depths of the ocean and the heart of the atom,
but we have a fear of looking inward to ourselves because we sense that is where
all the contradictions flow together." -- Terrence Mckenna

User avatar
computistxyz
Regular
Posts: 58
Joined: Thu Jul 10, 2014 8:35 am
Github: sjgriffiths
Location: Coventry/Norwich, UK
Contact:

Re: Preferences imagemap selection/testing preference variab

#3 Post by computistxyz »

I'm still not sure why it happens, but I've fixed the issue by manually defining the selected condition quite simply:

Code: Select all

hotspot (1528, 479, 68, 43) action [Preference("display", "window"), SelectedIf(_preferences.fullscreen==False)]
Might be useful for other people experiencing a similar issue.

Post Reply

Who is online

Users browsing this forum: No registered users