remember YScrollValue
Posted: Mon Oct 12, 2020 6:06 am
A very simple thing is turning into a problem...
I have a screen with a vpgrid. I have a vbar. The scroll works quite nicely with:
All is great.
However, once I close this screen I want a variable to remember where I left off. So that next time I don't start from the top again.
Obviously I should add:
where the default y = 0
And when closing the screen I should somehow set y = current YScrollValue. And that's where I hit the problem.
How do I get the current value? I tried playing around with ui.adjustment and renpy.get_widget(vpid).yadjustment and all sorts of stuff but somehow I can't piece it together. So, any simple and elegant solution where I can add to the action of a button something like:
action Function(make y=current yadjustment(vpgridid))
??
I have a screen with a vpgrid. I have a vbar. The scroll works quite nicely with:
Code: Select all
vbar value YScrollValue("id of vpgrid")However, once I close this screen I want a variable to remember where I left off. So that next time I don't start from the top again.
Obviously I should add:
Code: Select all
yinitial yAnd when closing the screen I should somehow set y = current YScrollValue. And that's where I hit the problem.
How do I get the current value? I tried playing around with ui.adjustment and renpy.get_widget(vpid).yadjustment and all sorts of stuff but somehow I can't piece it together. So, any simple and elegant solution where I can add to the action of a button something like:
action Function(make y=current yadjustment(vpgridid))
??