Local fade (transition)

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
Eliont
Regular
Posts: 111
Joined: Thu Aug 06, 2009 6:51 am
Completed: Begin of Evangelion, SAO - Smile of the black cat, SAO - Project "Ceramic Heart", Time for Dragons
Location: Russia
Contact:

Local fade (transition)

#1 Post by Eliont »

Pleas, how to do it?
When i use dissolve - all right, it affect only character sprite.
When fade - transition play fullscreen.

If use

Code: Select all

renpy.transition(Fade(0.5,0,0.5,widget=ui.image(ImageReference(unit[pointer].sprite),xpos=0.5,ypos=0.5))) 
at first sprite (without transparency) shown on left top corner, and only then - in center.

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: Local fade (transition)

#2 Post by Jake »

Eliont wrote:Pleas, how to do it?
When i use dissolve - all right, it affect only character sprite.
When fade - transition play fullscreen.
What exactly do you want to happen?

'Fade' is supposed to fade to black, then fade back in with the changes made. Like a scene change in a movie.

Do you want the individual sprite to fade to black, like a silhouette, and then go back to normal?

(If that's the case, I would say you should:
- create a new copy of your sprite which is all black, maybe by using im.MatrixColor and im.matrix.brightness with a brightness of -1 (most-dark)
- dissolve to your new dark sprite, then dissolve back to a normal sprite?)
Server error: user 'Jake' not found

Eliont
Regular
Posts: 111
Joined: Thu Aug 06, 2009 6:51 am
Completed: Begin of Evangelion, SAO - Smile of the black cat, SAO - Project "Ceramic Heart", Time for Dragons
Location: Russia
Contact:

Re: Local fade (transition)

#3 Post by Eliont »

Thanks, exactly what i need.

Code: Select all

        renpy.transition(Dissolve(0.3))
        at_coords (unit[pointer].pos[0],unit[pointer].pos[1],0.5,1.0)
        ui.image(im.MatrixColor(ImageReference(unit[pointer].sprite),im.matrix.brightness(1)))
        ui.pausebehavior(0.3)
        ui.interact()
        renpy.transition(Dissolve(0.3))
        at_coords (unit[pointer].pos[0],unit[pointer].pos[1],0.5,1.0)
        ui.image(im.MatrixColor(ImageReference(unit[pointer].sprite),im.matrix.opacity(0)))     
        ui.pausebehavior(0.4)
        ui.interact()

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot]