Background move horizontal

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
johnstag123
Newbie
Posts: 14
Joined: Mon Dec 02, 2013 7:27 am
Contact:

Background move horizontal

#1 Post by johnstag123 » Mon Dec 02, 2013 7:42 am

Hi, I'eve been using renpy for quite a while now and I'm wondering how do you make a Bg move horizonatal (left to right.) I need it for the menu screen.

This is the picture I want to move horizontal
http://www.windsim.com/images/sky/sky_107.bmp

Thanks in advance.

User avatar
spiral
Regular
Posts: 44
Joined: Mon Mar 04, 2013 5:48 am
Location: Australia
Contact:

Re: Background move horizontal

#2 Post by spiral » Mon Dec 02, 2013 8:33 am

Do you want an animation of the sky moving across the screen like the clouds are in a breeze? If so here's how to do that inside the game:

Code: Select all

image bg clouds:
    parallel:
            "./sky_tile.jpg"
    parallel:
            xpos 0 ypos 0 xanchor 0 yanchor 0
            linear 5.0 xpos -1200 ypos 0
            repeat
# The game starts here.
label start:
    scene bg clouds
    menu:
        "Clouds?":
            "Yep!"

    return
I had to make my own 2400 pixel wide tiling version of your image to make the transition smooth.

I don't think this will work with the title menu, but here's a topic about animating title screens that may or may not be helpful (I must admit I didn't understand all of it myself!).

Note: I am really not an expert on animation so this may not be the best approach.
Attachments
sky_tile.jpg
tiling clouds image

User avatar
xavimat
Eileen-Class Veteran
Posts: 1458
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Contact:

Re: Background move horizontal

#3 Post by xavimat » Mon Dec 02, 2013 9:32 am

The same than sqbr has said, a little simpler:

Code: Select all

image bg clouds:    
    "sky_tile.jpg"
    yalign .5 # not needed if your image has the same height than the screen
    block:
        xalign 0.0
        linear 5.0 xalign 1.0
        repeat

# The game starts here.
label start:
    scene bg clouds
    menu:
        "Clouds?":
            "Yep!"
    return
In a screen:

Code: Select all

add "bg clouds"
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

Post Reply

Who is online

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