interactable scrolling image [SOLVED]

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
Newprogrammer
Newbie
Posts: 17
Joined: Sat Oct 20, 2018 10:28 am
Contact:

interactable scrolling image [SOLVED]

#1 Post by Newprogrammer »

Hello, i have a problem figuring out how to make an interactablec scrolling image.

Code: Select all

init python:
    scrollValue = 1200
        
    def storeScrollValue(x):
        global scrollValue
        scrollValue = x
        
screen scrollingScene:
    
         
    viewport:
        xadjustment adj
         
        scrollbars None
         
        child_size(3200, 600)
         
        draggable True
        
        edgescroll(200, 500)
        
        
        imagebutton:
            idle "Backgrounds/door.png"
            hover "Backgrounds/door.png"
            action [Hide ("door"), Jump ("preDialogue")]
            xpos 2624
            ypos 111  
        add "Backgrounds/street.png"
         
        
         
screen map:
    imagebutton:
        idle "Backgrounds/door.png"
        hover "Backgrounds/door.png"
        action [Hide ("door"), Jump ("preDialogue")]
        xpos 2624
        ypos 111
    use scrollingScene
As you can see firstly i tried to make a scolling image and then i used that screen in the second one with an image button that has to jump to a label once clicked. Problem is it doesn't work, when i runned the program it showed only the "scrollingScene" screen, and the imagebutton didn't work...
Last edited by Newprogrammer on Sat Apr 27, 2019 10:40 am, edited 1 time in total.

User avatar
Alex
Lemma-Class Veteran
Posts: 3093
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: interactable scrolling image

#2 Post by Alex »

That's ok 'cause the order of elements onscreen matters. In your scrollingScene screen you show the button and then show bg image (street.png) over it, so button is not visible. Then, in the map screen, you show button and "use" scrollingScene screen, so it shown over your button.

Try to change the order of elements of screens.

Newprogrammer
Newbie
Posts: 17
Joined: Sat Oct 20, 2018 10:28 am
Contact:

Re: interactable scrolling image [SOLVED]

#3 Post by Newprogrammer »

You're right, thanks as alway Alex.

Post Reply

Who is online

Users browsing this forum: No registered users