Current Displayable position / Translation values of Layer

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
User avatar
Posts: 146
Joined: Tue Nov 05, 2013 7:37 am
Completed: The Iron Heart Witch
Projects: Y;N, Crime•Scene
Location: Germany

Current Displayable position / Translation values of Layer

#1 Post by Mirrowdothack » Wed Jul 19, 2017 4:30 pm

Hello you guys. I hope you can help me out:

How do I get the exact, current pixel position of a Displayable on the screen?
Currently I do the following:

Code: Select all

displayable = renpy.scene_lists().get_displayable_by_tag("myLayer", "myDisplayable")
displayPosition = displayable.get_placement()[0:2]
But this approach isn't working correctly:
1) displayPosition won't be updated for every type of displayable (I don't realy understand this at the time. Some seem to work, other don't).
2) displayPosition won't be changed by any transforms, that are applied to the whole layer ("myLayer") of the displayable ("myDisplayable").

The goal is to get the translation & zoom values of a specific layer (For me a layer is like a local coordinate system).

Can you help me to get these pieces of information?
My games:
Image Image

Post Reply

Who is online

Users browsing this forum: Google [Bot], lunamoon