How to flip images?
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.
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.
- Mammon
- Miko-Class Veteran
- Posts: 712
- Joined: Sat Nov 07, 2015 3:09 pm
- Completed: Pervert&Yandere, Stalker&Yandere
- Projects: Roses Of The Thorn Prince
- Contact:
How to flip images?
Hi,
Is there a way to flip images in Ren'py other than the im.Flip method? Preferably one that doesn't require you to define each sprite this way rather than putting something behind the sprite appearing similar to 'at right' or 'with dissolve'. Im.Flip doesn't work for me to begin with because it says I've got 10 variables (while I only have 4), and having to make a flipped image of most or even all combinations of a sprite would be hellish. Even if I wouldn't do it for the main characters, the side characters can easily have 150-200 expression combinations that would require a im.flip on top of their im.composite.
Thanks for your help in advance!
Is there a way to flip images in Ren'py other than the im.Flip method? Preferably one that doesn't require you to define each sprite this way rather than putting something behind the sprite appearing similar to 'at right' or 'with dissolve'. Im.Flip doesn't work for me to begin with because it says I've got 10 variables (while I only have 4), and having to make a flipped image of most or even all combinations of a sprite would be hellish. Even if I wouldn't do it for the main characters, the side characters can easily have 150-200 expression combinations that would require a im.flip on top of their im.composite.
Thanks for your help in advance!
- Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
- Contact:
Re: How to flip images?
xzoom = -1
Inline use would be something like:
You could, if needed, set the xzoom value as a variable and toggle it between 1 (normal) and -1 (flipped)
Inline use would be something like:
Code: Select all
show expression Transform("eileen_composite", xzoom=-1)
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
- Mammon
- Miko-Class Veteran
- Posts: 712
- Joined: Sat Nov 07, 2015 3:09 pm
- Completed: Pervert&Yandere, Stalker&Yandere
- Projects: Roses Of The Thorn Prince
- Contact:
Re: How to flip images?
Thanks for the fast reply and advice! Much appreciated!
Unfortunately... It refuses to work. When I put it exactly as you say with capitalised T it does nothing at all. When I make it a t ren'py demands an end of the line right before transform. If I add transform etc. in another line they expect an end of the line after transform before (. When I add just xzoom=-1 it says the same about between zoom and =.
I know variables, but I wouldn't know how to combine it with xzoom. At least, not without setting $ xflip = 1 or -1 followed by "image x expression = im.flip(images/etc...) and then having to define each expression after all. And I've tried adding variables to images before for outfits but that didn't work in general (when these contain more than 5 .pngs to combine, causing a too many variables issue).
Might it be a version thing that this works with an older version? I've already experienced that the latest renpy versions no longer allow certain things like zorder, might this be similarly a version issue? I've updated to the latest version for this advise and found it being the same issues as above, except that Transform now made the sprite disappear entirely where before it remained unchanged.
(Isn't it nice, ren'py telling you it wanted to start at the point you were before the update, telling it cannot go there because there's no rollback for it, and then suddenly adding all the languages in your project folder? Updates...)
- Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
- Contact:
Re: How to flip images?
What exact code are you trying? Anything like?
Code: Select all
image composite_image = Composite(
(300,200),
(0, 0), Text("Words", size=40, color="#F00"),
(0, 50), Text("Words", size=40, color="#FFF"),
(0, 100), Text("Words", size=40, color="#00F"),
(0, 150), Text("Words", size=40, color="#777") )
label start:
show expression Transform("composite_image", xzoom = -1)
"..."
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
-
- Regular
- Posts: 169
- Joined: Sun Jun 04, 2017 12:05 pm
- Completed: Too many, check signature
- Deviantart: mikolajspy
- Location: Wrocław, Poland
- Contact:
Re: How to flip images?
You can define negative xzoom as your own transform and use that. It works without issues in my project.
Somewhere outside labels:
and when you want to show flipped image, just...
Somewhere outside labels:
Code: Select all
transform flip:
xzoom -1
Code: Select all
show mycharacter at flip
- Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
- Contact:
Re: How to flip images?
Oh yeah, that's easier. Could also just do:
for the occasional one.
Code: Select all
show my_composite_image:
xzoom -1
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
- Mammon
- Miko-Class Veteran
- Posts: 712
- Joined: Sat Nov 07, 2015 3:09 pm
- Completed: Pervert&Yandere, Stalker&Yandere
- Projects: Roses Of The Thorn Prince
- Contact:
Re: How to flip images?
@remix: Jup, something alike your first reaction though without size and color, and using Transform at all didn't seem to work. And similarly to before ren'py doesn't allow show <name>: enter xzoom=-1.
@mikolajspy: Oh, that one works, even when combining it with other at commands. Thanks a lot!
@mikolajspy: Oh, that one works, even when combining it with other at commands. Thanks a lot!
- xavimat
- Eileen-Class Veteran
- Posts: 1461
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Discord: xavimat
- Contact:
Re: How to flip images?
For the very, very fussy:
Note that flipping the image of a person that has clothes with buttons on it will change the normal orientation of the buttons. (or has a scar,a tattoo, or a single earring, or any non-symmetrical feature).
I'd never thought about it until an artist pointed it out in this forums some time ago.
Note that flipping the image of a person that has clothes with buttons on it will change the normal orientation of the buttons. (or has a scar,a tattoo, or a single earring, or any non-symmetrical feature).
I'd never thought about it until an artist pointed it out in this forums some time ago.
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Who is online
Users browsing this forum: No registered users