Page 1 of 1

Change position of an existing screen with Use statement

Posted: Sun Jun 09, 2019 12:37 pm
by abeplaga
Hi, I'm trying to do the following, but I can't get it.

I have created a map screen that shows many images and buttons on the right side of the game, but I have thought that sometimes it can be shown on the left but I don't know if I can use the existing screen for it or make a new one by changing the positions of the images and the buttons.

Trying and investigating I have found this https://www.renpy.org/doc/html/screens.html#use but I don't know if I can make a call of the screen with Use changing the position in this simple way. To be tested I have created a new screen "map_on_left_ with a use statement that calls the original screen map with a change in position but it doesn't work

Code: Select all

screen map_on_left:
    use map:
        xpos -500
Maybe it can be done in some similar way, but I don't know how. If anyone can help me, I thank you in advance!

Re: Change position of an existing screen with Use statement

Posted: Sun Jun 09, 2019 1:15 pm
by Remix
You could pass parameters into the screen:

Code: Select all

screen map( xalign=1.0, xanchor=1.0 ):
    vbox:
        xalign xalign
        xanchor xanchor
        # buttons

...
    use map # right side

    use map(0.0, 0.0) # moved to left side

Re: Change position of an existing screen with Use statement

Posted: Mon Jun 10, 2019 7:24 pm
by abeplaga
Remix wrote: Sun Jun 09, 2019 1:15 pm You could pass parameters into the screen:

Code: Select all

screen map( xalign=1.0, xanchor=1.0 ):
    vbox:
        xalign xalign
        xanchor xanchor
        # buttons

...
    use map # right side

    use map(0.0, 0.0) # moved to left side
I don't know that! Thanks, I'll try.