Gallery().make_button too small in the new GUI

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
Satsuki
Newbie
Posts: 23
Joined: Sun Oct 30, 2011 10:14 am
Location: Austria
Contact:

Gallery().make_button too small in the new GUI

#1 Post by Satsuki »

Hi, I'm trying to make use of the new GUI and got a problem by making a gallery:
button too small
button too small
By hovering the button (left) you can see, that the real button doesn't even have 1/3 of the height it should have. If I click on the button outside of this hovered field, the button doesn't react.

This is my code:

Code: Select all

image cg1 = "cg/c0_i1.png"
image cg2 = "cg/c0_i2.png"

init python:
    
    g = Gallery()
    
    g.hover_border = Color((255, 250, 250, 200))
    
    g.button("chara0_illust1")
    g.unlock_image("cg1")
    
    g.button("chara0_illust2")
    g.unlock_image("cg2")
    
screen gallery():

    tag menu
    
    use game_menu(_("Galerie"), scroll="viewport"):
        
        style_prefix "galerie"
        
        vbox:
            spacing 23
                
            grid 2 1:
            
                frame:
                    add g.make_button("chara0_illust1", "cg/thumb/c0_i1.png", locked="cg/thumb/locked.png")
                    text g.get_fraction("chara0_illust1")
                    
                frame:
                    add g.make_button("chara0_illust2", "cg/thumb/c0_i2.png", locked="cg/thumb/locked.png")
                    text g.get_fraction("chara0_illust2")

style galerie_frame:
    xysize(300,200)

Code: Select all

label start:
    
    scene cg1

    e "Random Text."

    return
Looking up into the inspector, it seems that the button has default button styles.
inspector screen
inspector screen

Code: Select all

# code from gui.rpy
define gui.button_height = 36
Changing the ysize of the button would solve my problem, but I couldn't manage to change it without changing the default height in gui.rpy.
I would be glad about some help please.

Post Reply

Who is online

Users browsing this forum: AdsBot [Google], Ocelot, snotwurm