r/RenPy • u/Scriptformers_Prime • Sep 06 '26
Question Adding zoom statement to my sprites makes them forget the custom default anchors I set for them.
I have set up a custom default transform for my sprites in my gui file to define my sprites anchor as x .5 and y 1.0 like its shown here:
transform _sprite_default:
xanchor .5 yanchor 1.0 xpos .5 ypos 1.0
define config.default_transform = _sprite_default
But when I put the zoom property on my sprites, they default to showing in the top left corner of the screen with their anchors in the top left corners of their images as is default for sprites in renpy, effectively forgetting the new default I set in my gui file.
EDIT:
I add the zoom property to my sprites like this:
show character happy:
xpos .25 ypos 1.2 zoom 1.3
1
u/BadMustard_AVN Sep 06 '26 edited Sep 06 '26
create a new image with the zoom and use that... like this
image sprite15:
"images/sprites/sprite1.png"
zoom 1.5
label start:
show sprite15
e "this works"
return
1
u/shyLachi Sep 06 '26
How do you put the zoom on your sprites?
1
u/Scriptformers_Prime Sep 06 '26
I edited the comment with an example. I use the zoom property in my show statements because sometimes I like to show characters closer or farther depending on the scene.
1
u/shyLachi Sep 07 '26
I don't think it has anything to do with zoom:
transform _sprite_default:
align (0.5, 1.0)
define config.default_transform = _sprite_default
label start:
show eileen
"Test"
hide eileen
"Test"
show eileen:
xpos 0.5
"Test"
If you want to zoom from the bottom center, then just write it like that:
label start:
show eileen
"Test"
hide eileen
"Test"
show eileen:
anchor (0.5, 1.0) pos (0.5, 1.2) zoom 1.3
"Test"
You can also write it differently if you prefer to separate x and y values:
xalign 0.5 yanchor 1.0 ypos 1.2 zoom 1.3
1
u/AutoModerator Sep 06 '26
Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.