position png images
position png images
Hi and sorry for my bad english. I just started using renpy and I had a question about images. I wanted to place png images in specific areas of the scenario by setting the area where they should be, for example (300,350,768,169). Forgive me for the stupid and banal question, but I hope you can help me.
-
- Veteran
- Posts: 344
- Joined: Tue Nov 21, 2017 2:23 am
- Completed: Eidolon, Minion!, Love Furever, Epilogue
- Contact:
Re: position png images
https://www.renpy.org/doc/html/displaying_images.html gives some good information as to how to position images.
To place the image where you want, you do something along the lines of:
(You'll need to change the xalign and yalign coordinates to where you want the image.)
You can also do other fancy stuff like shrink the image, rotate it, have it zoom in or out, etc.
To place the image where you want, you do something along the lines of:
Code: Select all
show image.png:
xalign 0.5 yalign 0.5
You can also do other fancy stuff like shrink the image, rotate it, have it zoom in or out, etc.
Enjoy Eidolon, my free to play game at: https://mutive.itch.io/eidolon, Minion! at: https://mutive.itch.io/minion or Epilogue at: https://mutive.itch.io/epilogue
Re: position png images
Thank you very much for your reply. I also wanted to know if there was a way to understand the xalign and yalign coordinates of a point. Pressing Shift + O opens the developer tool and by selecting an image I can see (x, y, length and height) of it. I wanted to know if instead of (x, y, length, height) I could know the xalign and yalign coordinates. Thank you very much for your help, you are really kind and helpful .
-
- Veteran
- Posts: 344
- Joined: Tue Nov 21, 2017 2:23 am
- Completed: Eidolon, Minion!, Love Furever, Epilogue
- Contact:
Re: position png images
I'm not sure (I haven't worked with the developer tool, so know essentially nothing about it!).
xalign and yalign, though, refer to a relative position vs. an absolute position (e.g. how far off from center the image is vs. which pixel it's on). There's almost certainly a way to translate from one to the other, but I'm not sure how complicated it would be to do. (The Cookbook might mention this somewhere.)
xalign and yalign, though, refer to a relative position vs. an absolute position (e.g. how far off from center the image is vs. which pixel it's on). There's almost certainly a way to translate from one to the other, but I'm not sure how complicated it would be to do. (The Cookbook might mention this somewhere.)
Enjoy Eidolon, my free to play game at: https://mutive.itch.io/eidolon, Minion! at: https://mutive.itch.io/minion or Epilogue at: https://mutive.itch.io/epilogue
Re: position png images
Thank you very much for the time and patience, I'll look in the cookbook
Who is online
Users browsing this forum: No registered users