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.
transform scrollin:
xpos 1920 yalign 0.5
pause 1.0
linear 2.0 xoffset -1400
transform scrollout:
linear 2.0 xoffset -800
When I apply these to an image, scrollin works as intended (move from right to left), but with scrollout what happens is the image moves 800 pixels to the right. What is the cause of the problem and how do I fix it?
Edit: I found a clue, I think. I switched the -800 with -2000. For some reason that does register as leftward movement... but what is the reason?
I've posted a similar topic recently, but this is technically a different function and probably has a different cause.
You are using xoffset, which basically moves the image's anchor point by the offset amount.
When you go to scroll it out, it uses the offset as its start point because it has been anchored there.
Imagine a sheet of A4 paper. The bottom left is your reference point. If you offset the position, the reference point moves off the paper, instead of moving the paper. Then, when you go to move it from what you expect is 0,0, it is really -1400,0, so moving the offset to -800 will move it to the right (because -800 is further right than -1400)
I suggest using xalign or xpos for all positioning.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.