Making characters flip when changing expressions

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
metapropanium
Newbie
Posts: 4
Joined: Fri Feb 26, 2016 2:17 pm
Tumblr: unicodepepper
Contact:

Making characters flip when changing expressions

#1 Post by metapropanium »

Yeah, if you played "Sonic Battle" for GBA you know what I'm talking about. Basically, to make this happen on every expression change (like a cardboard figure flipping over):

transform flip:
linear 0.2 xzoom 0.0
[[change picture]]
linear 0.2 xzoom 1.0

That's easy to implement as an ATL, but I was asking to implement it like this:

g happy "sample text" with flip

or something like that. (If there is any way to change the default transition, it would help a lot too)

User avatar
Hijiri
Eileen-Class Veteran
Posts: 1519
Joined: Sun Mar 25, 2012 6:35 pm
Completed: Death Rule:lost code Overdrive Edition, Where the White Doves Rest-Tsumihanseishi
Projects: Death Rule: Killing System
Organization: MESI Games
IRC Nick: Hizi
Tumblr: mesigames
Skype: kurotezuka
itch: hijiri
Location: Los Angeles
Contact:

Re: Making characters flip when changing expressions

#2 Post by Hijiri »

Code: Select all

 g happy "Let's try this."
g "Here we go...":
xzoom -1
g happy "...and now we go back":
xzoom 1
Image Image
"Perfection goal that always changes. Can pursue, cannot obtain."

User avatar
gas
Miko-Class Veteran
Posts: 842
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: Making characters flip when changing expressions

#3 Post by gas »

Hijiri wrote:

Code: Select all

 g happy "Let's try this."
g "Here we go...":
xzoom -1
g happy "...and now we go back":
xzoom 1
mmm...no.

Define some transform at the start of the script.

Code: Select all

transform myflip: #flipped image
    xzoom -1
transform mybackflip: #back to normal
    xzoom 1
then in your script...

Code: Select all

    show sanichegehog at myflip
    e "Look, I'm flipped!"
    show sanichegehog at mybackflip
    e "Back to normal"
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.

10 ? "RENPY"
20 GOTO 10

RUN

Post Reply

Who is online

Users browsing this forum: No registered users