Thanks for the detailed write up. I actually changed the way the background is changed for thoughts. Here's a screenshot of the current code (old code is commented out below). Currently I've only deployed it in the Android release, but it will be in all of them when v0.2 comes out.
That works.
Here's why the error happened:
This is your thoughtsmobile style code
Code:
style thoughtsmobile is window:
variant "small"
xalign 0.5
xfill True
yalign gui.textbox_yalign
ysize gui.textbox_height
background Image("gui/phone/thoughtsmobile.png", xalign=0.5, yalign=1.0)
See the
variant"small" line? That makes this style only exist for small variant phones.
But you called it using
Code:
if renpy.variant("touch"):
All small devices may be touch, but not all touch devices are small.
So what happens when you play the game on a touch device that isn't using the small variant?
The condition "if renpy.variant("touch"):" goes through on all touch devices, but the style thoughtsmobile doesn't exist outside of small variants, leading to the error "Style 'thoughtsmobile' doesn't exist"
You solved it by not calling thoughtsmobile at all & adjusting the background directly.
But to solve the actual problem you just needed the condition for calling the style & the variant of the style to be consistent, either small or touch.
I chose small cause thoughtsmobile isn't necessary outside of small variant devices.
Although if what you're saying is accurate, I may still need to adjust what is now line 141 to "small" instead of "touch."
That's a good idea.
Like I said, the problem could also be solved by changing the line in style thoughtsmobile to variant "touch", but I chose to change the trigger to small variants only.
This is because thoughtsmobile is not necessary for non-small variants. Only in small variants the bigger texts go outside the cloud background's border.
Using Joiplay allowed me to toggle small variants on & off, I had no issues with the text overflowing when using style thoughts while small variants was turned off.
So any change in your current code isn't necessary.
But the thoughts style looks better than thoughtsmobile imo & there's no reason to use it across all touch devices when only small variants need it due to their enlarged text.
Oh, also, turning off side images don't work, you forget to remove # from " #if not renpy.variant("small") and persistent.sideimagestate:"
Good Luck dev