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.
screen say(who, what):
style_prefix "say"
drag:
drag_name 'screen_say'
window:
id "window"
if who is not None:
window:
id "namebox"
style "namebox"
text who id "who"
text what id "what"
and I want it to move into a certain position, ideally with ease effect something like
e 'and now i move your draggable say screen!'
show screen_say:
ease .5 pos (0,400)
pause 1
e 'see? it's moving. It's alive!'
unfortunately it seems transforms cannot be applied directly on screens, and I have no idea of how to approach the drag within a screen. So I would be thankful for any suggestions!
Last edited by SONTSE on Fri Feb 15, 2019 11:32 am, edited 1 time in total.
Thanks! That surely did lead to a working solution.
Although it won't work like this because no say screen is shown when $ scripts are executed,
hence get_widget returns None instead of a widget.
So there is some tricky way to actually get this done.
init python:
def drag_move(drag):
try:
drag.snap(0,400,delay=.5)
except:
pass
screen move_drag:
default say_drag = renpy.get_widget('say','drag')
timer 1 action Function(drag_move,say_drag)
screen say(who, what):
on 'show' action Show('move_drag')
drag:
style_prefix "say"
drag_name "screen_say"
id "drag"
yalign 1.0
window:
id "window"
if who is not None:
window:
id "namebox"
style "namebox"
text who id "who"
text what id "what"
label main_menu:
return
label start:
'Look! It\'s moving!'
'It\'s alive!'
return