[SOLVED] How can I get the x and y coordinates of the viewport?

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
felsenstern
Regular
Posts: 72
Joined: Tue Jul 11, 2017 2:13 am
Contact:

[SOLVED] How can I get the x and y coordinates of the viewport?

#1 Post by felsenstern »

Hi,

when I'm using a viewport with a larger scrollable screen, how can I get and save the x and y coordinates of the viewport in a variable?
Last edited by felsenstern on Sun Jun 20, 2021 6:52 am, edited 1 time in total.
---
Yes, I've Read The F*cking Manual
Yes, I've used the f*cking search function
Yes, I've used a site search
No, I don't need a reminder that search functions exist
No, I don't need your astonished outbreak that I couldn't find the information
No, I don't need your answer if you can't just give it without all the BS around it

User avatar
Alex
Lemma-Class Veteran
Posts: 3090
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: How can I get the x and y coordinates of the viewport?

#2 Post by Alex »

If you'll make it like this - viewtopic.php?f=8&t=58441#p526802
You'll be able to get values like

Code: Select all

"[my_x_adj.value] / [my_y_adj.value]"

felsenstern
Regular
Posts: 72
Joined: Tue Jul 11, 2017 2:13 am
Contact:

Re: How can I get the x and y coordinates of the viewport?

#3 Post by felsenstern »

sweet, thanks a lot!
---
Yes, I've Read The F*cking Manual
Yes, I've used the f*cking search function
Yes, I've used a site search
No, I don't need a reminder that search functions exist
No, I don't need your astonished outbreak that I couldn't find the information
No, I don't need your answer if you can't just give it without all the BS around it

Post Reply

Who is online

Users browsing this forum: No registered users