Moving backgrounds, bigger than 800x600

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
Feteo
Newbie
Posts: 17
Joined: Sun Oct 31, 2010 1:02 pm
Contact:

Moving backgrounds, bigger than 800x600

#1 Post by Feteo »

Problemtime!

I have got a picture, a background, which happens to be 800x1115px big.
I want Ren'py to start showing the upper half of the picture and slowly move towards the lower half of it and stop there, so that the player can see everything from the picture. I know, it has to do something with ATL, but I totally don't get it, how to do that kind of "automatic scrolling". Help required :lol:

Thanks in advance!
Last edited by Feteo on Thu Mar 01, 2012 8:23 am, edited 2 times in total.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Moving backgrounds, bigger than 800x600

#2 Post by PyTom »

Probably the easiest way to do this is with the ATL crop command. That crops out a portion of the image. I'm assuming your game is 800x600, so you can write:

Code: Select all

transform pandown:
    crop (0, 0, 800, 600)
    linear 3 crop (0, 515, 800, 600)

# ...

show bg bigbeach at pandown
This takes 3 seconds to do the pan. 515 is 1115 - 600, the height of the screen.

Hope this helps.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Feteo
Newbie
Posts: 17
Joined: Sun Oct 31, 2010 1:02 pm
Contact:

Re: Moving backgrounds, bigger than 800x600

#3 Post by Feteo »

That definitely helps, I'm gonna test it later.

And since we're on that: Is there a way to change the 800x600 game screen? Where can I do that?

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Moving backgrounds, bigger than 800x600

#4 Post by PyTom »

Take a look at the start of options.rpy.

Note that if you change the size, you'll need to change the crop as well.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Feteo
Newbie
Posts: 17
Joined: Sun Oct 31, 2010 1:02 pm
Contact:

Re: Moving backgrounds, bigger than 800x600

#5 Post by Feteo »

Awesome, everything works out very well! I'm grateful for the good support! Keep the good work up!

Feteo
Newbie
Posts: 17
Joined: Sun Oct 31, 2010 1:02 pm
Contact:

Re: [Solved!] Moving backgrounds, bigger than 800x600

#6 Post by Feteo »

Double Post, but I got another question:
Is there any way to disable clicking (and therefore skipping) while the wait-function is working? I used a wait-function, so that the moving background can do it's stuff, but I want the reader to be forced to watch it, so that he cannot skip it. Is that somehow possible?

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Moving backgrounds, bigger than 800x600

#7 Post by nyaatrap »

renpy.pause(hard=True) is only way I know of. for example,

Code: Select all

init:
    def say_wait(who, what, wait):        
        renpy.say(who, what, interact=False) 
        renpy.pause(delay=wait, hard=True)
label start:
    $say_wait("Eileen", "hello", 2)

Feteo
Newbie
Posts: 17
Joined: Sun Oct 31, 2010 1:02 pm
Contact:

Re: Moving backgrounds, bigger than 800x600

#8 Post by Feteo »

I have tried out some things, that were related to the "hard"-value you are proposing, but somehow it doesn't work.
I tried these ones:

Code: Select all

renpy.pause(delay=5, hard=True)
and

Code: Select all

pause(5, hard=True)
It isn't written down on the wiki either: http://www.renpy.org/wiki/renpy/doc/ref ... ions/Pause
Have I done something wrong?

Nevertheless, thanks for your help. :)

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Moving backgrounds, bigger than 800x600

#9 Post by nyaatrap »

It's a python code. Did you put "$" before the function?
The reason not written on the Wiki maybe it's not recommended.

Feteo
Newbie
Posts: 17
Joined: Sun Oct 31, 2010 1:02 pm
Contact:

Re: Moving backgrounds, bigger than 800x600

#10 Post by Feteo »

Ohhh, now it works... Sorry, I'm still very inexperienced! It works out just like I wanted it to be, thank you.

Still, another question: How do I prevent the player from rollbacking?

vociferocity
Regular
Posts: 93
Joined: Sat Jun 12, 2010 11:27 am
Projects: Rogue of Heart, Valkyrie
Contact:

Re: Moving backgrounds, bigger than 800x600

#11 Post by vociferocity »

it's nice and easy to stop a player from rolling back past a certain point, you just need to add in this line of code wherever you want the point of no return to be

Code: Select all

$ renpy.block_rollback()
I know you can totally disable rollback, if that's what you want, but I'm not sure how you go about doing it haha.

Post Reply

Who is online

Users browsing this forum: Amazon [Bot], Majestic-12 [Bot]