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.
Though you could *possibly* utilize AnimatedValue to linearly adjust the value over time, I am pretty sure there are other, simpler ways to accomplish what you want.
If you are just applying a transform when showing or hiding the screen, perhaps the on show: and on hide: event blocks within an ATL would be best.
What are you trying to do?
Remix wrote: ↑Sat Jan 13, 2018 9:58 am
Though you could *possibly* utilize AnimatedValue to linearly adjust the value over time, I am pretty sure there are other, simpler ways to accomplish what you want.
If you are just applying a transform when showing or hiding the screen, perhaps the on show: and on hide: event blocks within an ATL would be best.
What are you trying to do?
I have a button that I want to change whether information is shown or not.
The transition label has the role of transitioning the information on and off screen. The information is a separate screen. The x and y aligns are at 0.0 so by changing the anchors I figured the screen would move in and out.
Is there a better way of doing this?
How do show and hide events work?
label transition_label:
if screen_on:
linear 1.0 screen_x 1.0
linear 1.0 screen_x 1.0
$ screen_on= False
else:
linear 1.0 screen_x 0.0
linear 1.0 screen_x 0.0
$ screen_on= True
return
This code has no meaning in renpy. Actually, renpy label code is different from renpy screen code and from renpy ATL code.
"linear" is used inside ATL code (when defining transforms or in show block). In your code I assume that "screen_x" is a variable you have defined somewhere and you want "linear" to change the value of that variable, "linear" can't be used for that.
You can, on the other hand, define transforms that accept arguments, and show the main elements of a screen with that transform.
label start:
scene black
show screen test
"bla"
show screen test(1.0)
"bla2"
show screen test(0.5)
"bla3"
hide screen test
"bla4"
return
transform my_t(x):
linear 1.0 xalign x
screen test(x=0.0):
frame:
at my_t(x)
label "Hello world!"
You can show a screen that is already showed, and the new values pass to the transform, that adjusts (with "linear") to the new position.