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.
I'm having an issue with how quickly a variable sets. The idea is to let the player select between two color schemes. However, the styles and variables don't set with one click on either button, at least to begin with. There's some middling state, where some elements are orange and some are green. You have to double click to get what you want. Any suggestions as to why the variable doesn't 'set' properly?
Is anything conditional on orange or persistent.orange? You may need to set those before calling StylePreference. A lot depends on what the actual conditions are.
Supporting creators since 2004 (When was the last time you backed up your game?)
PyTom wrote:Is anything conditional on orange or persistent.orange? You may need to set those before calling StylePreference. A lot depends on what the actual conditions are.
Those images using Conditionswitch are. There are several images using the same kind of thing. In the above example, monitor1 and monitor2 are other defined images, with the Conditionswitch choosing between them based on the persistent.orange variable. Then in that prescreen, there's also the textbutton to choose to set orange and persistent.orange to True, I just didn't include it.
No that doesn't fix the issue. There's still a delay in that the coloring of the text and buttons (sometimes the image) doesn't set with just one click. Since it's the text sometimes too, that suggests there's an issue with StylePreference as well.
You can set the images as a part of the style definition, like a frame or window background property.
I think this is more consistent, and I applied the same to let the player choose the whole interface style between 5 colours. No bugs at all.
The choice get saved as a persistent value. So if you choose the red interface, next time you launch the game it start with the red one. If you load a game, it load the style definitions of that game.
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.
gas wrote:You can set the images as a part of the style definition, like a frame or window background property.
I think this is more consistent, and I applied the same to let the player choose the whole interface style between 5 colours. No bugs at all.
The choice get saved as a persistent value. So if you choose the red interface, next time you launch the game it start with the red one. If you load a game, it load the style definitions of that game.
Considering I'm using the overlay here, how would I apply a style to that image?