Affect ypos in image definition?

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
StValentines
Regular
Posts: 37
Joined: Mon Aug 26, 2019 2:08 am
Projects: St. Valentine's Academy for Magical Girls
Contact:

Affect ypos in image definition?

#1 Post by StValentines »

I'm still a beginner, and the positioning in this game has been giving me hell lately.

I use a series of defined placement transforms to place my characters, which includes a zoom transform so I can get them the right size while allowing them to be bigger so they can look good up close as well. I recently ironed out all the wrinkles and it's working great. Example:
transform fifty:
xalign 0.50
ypos 1.945
yanchor 1.0
zoom 0.56
But a couple sprites are inexplicably taller than they're supposed to be. It's obvious when they're placed next to other characters, despite all onscreen sprites having the exact same ypositioning, yanchoring, and zoom applied. I've looked at the original image and all the coding involved, can't for the life of me figure out why this is. But that's fine, I can just change the starting point of the image from the definition, right?

Well that works fine with the zoom. I just put it into the image definition, and it worked fine.
image kacy_body:
"kacy_spBODY.png"
zoom 0.97

layeredimage kacy:

always:
"kacy_body"
That zoom seems to stack with the zoom in my positioning code, so it makes the image that much smaller when it's displayed in-game. But I've tried also using ypositioning or yanchoring to affect its height, and that hasn't worked. I've tried it so many different ways, even deleting the zoom and putting a ypos adjustment in its place. Any suggestions?

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: Affect ypos in image definition?

#2 Post by Per K Grok »

StValentines wrote: Sat Apr 18, 2020 5:46 pm I'm still a beginner, and the positioning in this game has been giving me hell lately.

I use a series of defined placement transforms to place my characters, which includes a zoom transform so I can get them the right size while allowing them to be bigger so they can look good up close as well. I recently ironed out all the wrinkles and it's working great. Example:
transform fifty:
xalign 0.50
ypos 1.945
yanchor 1.0
zoom 0.56
But a couple sprites are inexplicably taller than they're supposed to be. It's obvious when they're placed next to other characters, despite all onscreen sprites having the exact same ypositioning, yanchoring, and zoom applied. I've looked at the original image and all the coding involved, can't for the life of me figure out why this is. But that's fine, I can just change the starting point of the image from the definition, right?

Well that works fine with the zoom. I just put it into the image definition, and it worked fine.
image kacy_body:
"kacy_spBODY.png"
zoom 0.97

layeredimage kacy:

always:
"kacy_body"
That zoom seems to stack with the zoom in my positioning code, so it makes the image that much smaller when it's displayed in-game. But I've tried also using ypositioning or yanchoring to affect its height, and that hasn't worked. I've tried it so many different ways, even deleting the zoom and putting a ypos adjustment in its place. Any suggestions?

ypos sets the image position in the vertical position in number of pixels from the top edge of the game screen, provided that you set the value as an integer (i.e. 200) not as a float (i.e. 1.945).

You can not divide a pixel.

If you use a float ypos seems to act like yalign.

If you want to have your images placed at a certain height, set ypos to that number of pixels from the top. You don't need yanchor.

Post Reply

Who is online

Users browsing this forum: Google [Bot]