Page 1 of 1

Shake Screen/Sprite

Posted: Fri Dec 22, 2017 7:25 pm
by neometalero
How can I shake the screen or the image sprite? I want the character to shake when there is dammage or an angry reaction for example.

Re: Shake Screen/Sprite

Posted: Fri Dec 22, 2017 8:45 pm
by Donmai
Choose a method: To shake the whole scene (including sprites, not sprites only) you can use the vpunch or hpunch transitions.
https://www.renpy.org/doc/html/transiti ... var-vpunch
https://www.renpy.org/doc/html/transiti ... var-hpunch
Or you can use this old cookbook recipe from the wiki (don't be afraid, it's old but it still works):
https://www.renpy.org/wiki/renpy/doc/co ... ake_effect
Alternatively, you can use an ATL transform. Personally, I think the python shake effect is still the best option.

Re: Shake Screen/Sprite

Posted: Fri Dec 22, 2017 10:25 pm
by neometalero
There is any way to only shake the sprite? not the hole scene?

Re: Shake Screen/Sprite

Posted: Fri Dec 22, 2017 11:09 pm
by Donmai
Look at the example script in the shake effect page.

Code: Select all

# shaking the sprite by placing it at the center (where it already was)
ph "Ng!..."
show phoenix at center, Shake(None, 1.0, dist=5)
with None
When you use the effect in a sprite you only have to add its position (left, center or right). If you don't the shaking sprite will appear at left position.

Re: Shake Screen/Sprite

Posted: Sat Dec 23, 2017 5:36 am
by Taleweaver
Moved to Ren'Py Questions.

Re: Shake Screen/Sprite

Posted: Sat Dec 23, 2017 10:45 am
by neometalero
Donmai wrote: Fri Dec 22, 2017 11:09 pm Look at the example script in the shake effect page.

Code: Select all

# shaking the sprite by placing it at the center (where it already was)
ph "Ng!..."
show phoenix at center, Shake(None, 1.0, dist=5)
with None
When you use the effect in a sprite you only have to add its position (left, center or right). If you don't the shaking sprite will appear at left position.
Tks a lot , I will try that

Re: Shake Screen/Sprite

Posted: Sat Dec 23, 2017 11:02 am
by neometalero
Ok that was actually really easy to do, tks for the help. When I first found that example It looked really complicated but it was actually quite simple to use.