Gallery Hover Misplacement.

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
KairuKyun
Veteran
Posts: 286
Joined: Thu Feb 12, 2015 4:10 pm
Completed: No One But You, Catch Canvas, Sickness, Written in the Sky, Wander no more, Warped Reality
Projects: Warped Reality
Organization: Unwonted Studios
IRC Nick: Kairu_kyun
Tumblr: karamuchan
Contact:

Gallery Hover Misplacement.

#1 Post by KairuKyun »

I have a CG gallery and for some reason the hover and idle borders are of place.
https://drive.google.com/open?id=0B7tyz ... authuser=0

Code: Select all

init python:
    
    #list of images
    gallery_cg_items = ["splash",
    "bridge_day",
    "bridge_night",
    "club_day",
    "club_night",
    "fronthouse_day",]

    # Page 2.

    
    #the rows and columns in the screen
    gal_rows = 3
    gal_cols = 2
    
    #thumbnail size in pixels
    thumbnail_x = 260
    thumbnail_y = 183   
    gal_cells = gal_rows * gal_cols    
    g_cg = Gallery()
    
    for gal_item in gallery_cg_items:
        
        g_cg.button(gal_item + " butt")
        g_cg.image(gal_item)
        g_cg.unlock(gal_item)
        g_cg.idle_border="assets/UI/gal_idle.png"
        g_cg. hover_border = "assets/UI/gal_hover.png"
    g_cg.transition = dissolve
    
    cg_page=0


init +1 python:
    #We made the lock buttons and such here
    for gal_item in gallery_cg_items:
        renpy.image(gal_item + " butt", im.Scale(ImageReference(gal_item), thumbnail_x, thumbnail_y))
        
screen cg_gallery:
    
    tag menu

    add "pref_bg"

    imagemap:
        
        auto "assets/UI/gallery_%s.png"

        hotspot (1103,15,148,121) action Return()
        
        hotspot (45,151,198,58) action [SetVariable('cg_page', 0), ShowMenu("cg_gallery")]
        #hotspot (45,218,198,58) action [SetVariable('cg_page', 1), ShowMenu("cg_gallery")]
        #hotspot (45,290,198,58) action [SetVariable('cg_page', 2), ShowMenu("cg_gallery")]
        #hotspot (45,355,198,58) action [SetVariable('cg_page', 3), ShowMenu("cg_gallery")]


    frame background None xpos 143:
        
        grid gal_rows gal_cols:
        
            ypos 168
            xpos 185
            
            $ i = 0
            $ next_cg_page = cg_page + 1 
            
            if next_cg_page > int(len(gallery_cg_items)/gal_cells):
            
                $ next_cg_page = 0
                
            for gal_item in gallery_cg_items:
            
                $ i += 1
                
                if i <= (cg_page+1)*gal_cells and i>cg_page*gal_cells:
                
                    add g_cg.make_button(gal_item + " butt", gal_item + " butt", im.Scale("assets/locked.png", thumbnail_x, thumbnail_y), xalign=0.5, yalign=0.5,  background=None, bottom_margin=24)
            
        for j in range(i, (cg_page+1)*gal_cells): #we need this to fully fill the grid
            null
Kyle Tyner
Creator of Unwonted Studios
ktyner@unwontedstudios.co
Visit Our Website
Projects: No One But You, Sickness, Written in the Sky, Wander no more, Catch Canvas, Warped Reality

User avatar
KairuKyun
Veteran
Posts: 286
Joined: Thu Feb 12, 2015 4:10 pm
Completed: No One But You, Catch Canvas, Sickness, Written in the Sky, Wander no more, Warped Reality
Projects: Warped Reality
Organization: Unwonted Studios
IRC Nick: Kairu_kyun
Tumblr: karamuchan
Contact:

Re: Gallery Hover Misplacement.

#2 Post by KairuKyun »

Anyone got an idea?
Kyle Tyner
Creator of Unwonted Studios
ktyner@unwontedstudios.co
Visit Our Website
Projects: No One But You, Sickness, Written in the Sky, Wander no more, Catch Canvas, Warped Reality

User avatar
yuucie
Regular
Posts: 164
Joined: Sun Jun 22, 2014 4:04 am
Completed: NaNoReNo[2015] Those Without Names
Tumblr: an-na-ko
Location: Toronto, Canada
Contact:

Re: Gallery Hover Misplacement.

#3 Post by yuucie »

I've had this problem when I change the images after implementation. Try these two things:

1) Rename all your GUI "assets/UI/gal_hover.png" to "assets/UI/gal_hover2.png", same with the idle image. Remember to rename them in the code too.
2) Clear the cache folder where your game is.

For some reason, even clearing the cache folder isn't enough; you'll have to rename your new assets too. Hopefully it'll fix itself.

User avatar
KairuKyun
Veteran
Posts: 286
Joined: Thu Feb 12, 2015 4:10 pm
Completed: No One But You, Catch Canvas, Sickness, Written in the Sky, Wander no more, Warped Reality
Projects: Warped Reality
Organization: Unwonted Studios
IRC Nick: Kairu_kyun
Tumblr: karamuchan
Contact:

Re: Gallery Hover Misplacement.

#4 Post by KairuKyun »

That didn't work.
Kyle Tyner
Creator of Unwonted Studios
ktyner@unwontedstudios.co
Visit Our Website
Projects: No One But You, Sickness, Written in the Sky, Wander no more, Catch Canvas, Warped Reality

Post Reply

Who is online

Users browsing this forum: LuckyT