Change position of an existing screen with Use statement

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
abeplaga
Regular
Posts: 34
Joined: Mon Oct 15, 2018 10:09 am
Contact:

Change position of an existing screen with Use statement

#1 Post by abeplaga » Sun Jun 09, 2019 12:37 pm

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!

User avatar
Remix
Eileen-Class Veteran
Posts: 1455
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Change position of an existing screen with Use statement

#2 Post by Remix » 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
Frameworks & Scriptlets:

User avatar
abeplaga
Regular
Posts: 34
Joined: Mon Oct 15, 2018 10:09 am
Contact:

Re: Change position of an existing screen with Use statement

#3 Post by abeplaga » Mon Jun 10, 2019 7:24 pm

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.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Meg'