[SOLVED] Trouble customising save/ load screen buttons

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
Kinmoku
Miko-Class Veteran
Posts: 560
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: Love IRL, Memories
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

[SOLVED] Trouble customising save/ load screen buttons

#1 Post by Kinmoku » Tue Jun 14, 2016 11:08 am

Hi all,

I really suck at screens and styles, and have gotten stuck trying to customise my save/ load screens to have an animation play when you hover over a slot.

Here's what it currently looks like:

Image

So the hover state currently changes the background colour, which does the job, but I want to remove it and use an animation instead, so that when you hover, the frame graphic will jiggle. I have the graphics and animation set up but as you can see here they aren't working/ visible. I think there must be another style overriding the one I want to use.

Screen:

Code: Select all

screen file_picker():    
    hbox:
        style "gm_root"
        
        add "images/save_load_bg.png" xanchor 0.5 yanchor 0 xpos 0.5 ypos 144

    $ columns = 3
    $ rows = 1

    hbox:
        style "file_picker"
        
        xpos 320
        ypos 400
        
        spacing 50

        # Display ten file slots, numbered 1 - 10.
        for i in range(1, 4):
            button:
                action FileAction(i)

                has vbox spacing 20

                add FileScreenshot(i) size(365,205) ypos 10

                $ file_name = FileSlotName(i, columns * rows)
                $ file_time = FileTime(i, empty=_("Empty Slot"))
                $ save_name = FileSaveName(i)

                text "[file_name]. [file_time!t]\n"
Style:

Code: Select all

    ## Save load button style
    
    config.thumbnail_width = 365
    config.thumbnail_height = 205

    style.file_picker = Style(style.menu_frame)
    style.file_picker_button = Style(style.file_button)

    style.file_button.background = "images/photos1.png"
    style.file_button.hover_background = "savejiggle"
Hover animation:

Code: Select all

image savejiggle:
    "images/photos1.png"
    0.1
    "images/photos2.png"
    0.1
    "images/photos3.png"
    0.1
    repeat
Last edited by Kinmoku on Wed Jun 15, 2016 5:58 am, edited 1 time in total.

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: Trouble customising save/ load screen buttons

#2 Post by IrinaLazareva » Tue Jun 14, 2016 1:36 pm

in screen file_picker()

Code: Select all

    hbox:
        style "file_picker"
try changing to

Code: Select all

    hbox:
        style_group "file_picker"

User avatar
Kinmoku
Miko-Class Veteran
Posts: 560
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: Love IRL, Memories
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Re: Trouble customising save/ load screen buttons

#3 Post by Kinmoku » Wed Jun 15, 2016 5:58 am

IrinaLazareva wrote:in screen file_picker()

Code: Select all

    hbox:
        style "file_picker"
try changing to

Code: Select all

    hbox:
        style_group "file_picker"
Uwahh, awesome! It worked! :D Thank you so much! I'm surprised it was such a simple fix!

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]