Hello, guys!
I need help. I'm trying to set the mouse button style property on group of imagebuttons, but with "<name>_button is button" style and "<name>" style_prefix it's working only on textbuttons. I don't want to set the property on every imagebutton separately, and i'm stuck with it. How to fix it? Does anyone have any ideas?
Тhank you in advance!
[Solved] How to apply a style_prefix to imagebuttons?
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.
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.
[Solved] How to apply a style_prefix to imagebuttons?
Last edited by Halleck on Wed Mar 29, 2017 11:45 pm, edited 1 time in total.
Re: How to apply a style(through style_prefix) to imagebutto
This isn't a very helpful OP. What are you trying to do exactly? What have you done that hasn't worked? What does your screen look like currently?
Re: How to apply a style(through style_prefix) to imagebutto
Hi, philat, thank you for your time. I give you a standard quick_menu screen for example:
In this example style_prefix "quick" doesn't work on imagebutton(only on textbuttons). It's just one imagebutton here, but i want to use multiple imagebuttons in many screens and i'm trying to figure out how to use style_prefix on them.
Code: Select all
screen quick_menu():
zorder 100
if quick_menu:
hbox:
style_prefix "quick"
xalign 0.5
yalign 1.0
textbutton _("Back") action Rollback()
textbutton _("History") action ShowMenu("history")
textbutton _("Skip") action Skip() alternate Skip(fast=True, confirm=True)
textbutton _("Auto") action Preference("auto-forward", "toggle")
#textbutton _("Save") action ShowMenu("save")
imagebutton auto "save_%s.png" action ShowMenu("save")
textbutton _("Q.Save") action QuickSave()
textbutton _("Q.Load") action QuickLoad()
textbutton _("Prefs") action ShowMenu("preferences")
init python:
config.overlay_screens.append("quick_menu")
default quick_menu = True
style quick_button is default
style quick_button_text is button_text
style quick_button:
properties gui.button_properties("quick_button")
mouse "button"
style quick_button_text:
properties gui.button_text_properties("quick_button")
Re: How to apply a style(through style_prefix) to imagebutto
I imagine it does work; it just doesn't use prefix_button. The quickest way to check styles, btw, is to run the game and use the style inspector (mouse on the element you want to check and shift+I). From what I saw, by default imagebuttons take prefix_image_button.
Re: How to apply a style(through style_prefix) to imagebutto
Thank you very much, it's just what i need and it works like a charm. I don't find it in documentation, but from now on i will follow your advice and use the style inspector.
Who is online
Users browsing this forum: Google [Bot]