You could use imagebuttons instead of text buttons! The cool thing about imagebuttons is you can make two images, one with a + sign on it and one with a - sign on it, and use those two images as clickable buttons.
Here's an example, where the + button is plus_tspeed.png and the - button is minus_tspeed.png. You can adjust their position on the screen using xpos and ypos. The action for the + button would be to increase the text speed, and the action for the - button would be to decrease the text speed.
Code: Select all
screen preferences:
tag menu # This ensures that any other menu screen is replaced.
add "BACKGROUND IMAGE FILE NAME HERE" # Background image for the prefs menu
use navigation # Include the navigation.
# Text speed buttons
imagebutton auto "plus_tspeed.png" xpos 475 ypos 190 focus_mask True action _______
imagebutton auto "minus_tspeed.png" xpos 475 ypos 190 focus_mask True action ______
You can use the following action in place of the ______ line:
So your code would look like this:
Code: Select all
screen preferences:
tag menu # This ensures that any other menu screen is replaced.
add "BACKGROUND IMAGE FILE NAME HERE" # Background image for the prefs menu
use navigation # Include the navigation.
# Text speed buttons
imagebutton auto "plus_tspeed.png" xpos 475 ypos 190 focus_mask True action Preference("text speed", ###)
imagebutton auto "minus_tspeed.png" xpos 475 ypos 190 focus_mask True action Preference("text speed", ###)
Replace ### with the speed you want. E.g. Putting 142 would make the text appear at a rate of 142 characters per second. (I found this action code in
this list of screen actions in the Ren'Py documentation!)
Since you want to be able to increase and decrease the text speed, remember that the number you put instead of ### in the above code would basically be an increment. Clicking the + button would increase the text speed by that specific amount (and vice versa for the - button), so you don't want the number to be too high.
I hope this helps!
