Is there a way to have a sprite fade in?

zarroc407

Veteran
Veteran
Joined
Jun 20, 2013
Messages
104
Reaction score
16
First Language
english
Is there a way to create an opacity slide type fade in for a single sprite? For example i have a mage side character that appears in a room during a scene rather then just having him show up I'd like to make him kind of fade in. Is this possible?
 

Berylstone

Veteran
Veteran
Joined
Jun 3, 2013
Messages
642
Reaction score
62
First Language
English
Primarily Uses
I would think you could just create an animation for the fade in and then set the event page that uses it to stepping animation.  You might also change the opacity during a move route to accomplish the effect you are going for.

But for example I just made a quick animation (Screen Shot).  You could add fire and smoke to it to make it more dramatic.  Then I created an event page (Screen Shot_1).  And I just turn On the switch when I want to activate the animation.

Screen Shot.png

Screen Shot_1.png
 
Last edited by a moderator:

Allerka

Veteran
Veteran
Joined
Dec 31, 2012
Messages
289
Reaction score
71
First Language
English
Primarily Uses
There's a couple different ways you could do this.

1: You can set a move route for the character in your event. The character's opacity starts at 0. Have the move route set the opacity to 12, wait a few frames, then set it to 24, wait a few frames, and repeat, until you reach 255 opacity, taking however many seconds you want it to.

2: Make a small picture of the ground underneath the character, and have it show above the character, so it looks like he's not there. Then just "move" the picture from 255 opacity to 0, and it should look like he's fading in. This one might be a little trickier, though.

In either case, though, this should do the trick.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Add this to your script list.

From a Call Script event command, enter this:

$game_map.events[id].change_opacity(opacity, frames)$game_player.change_opacity(opacity, frames)From a Set Move Route, add a Script command, and enter this:
Code:
change_opacity(opacity, frames)
to give a smooth fade in/out on a character.opacity is a number between 0 (invisible) and 255 (fully opaque)

frames is how many frames the fade should take.

class Game_CharacterBase #-------------------------------------------------------------------------- # * Initialize Private Member Variables #-------------------------------------------------------------------------- alias shaz_char_opacity_game_characterbase_init_private_members init_private_members def init_private_members shaz_char_opacity_game_characterbase_init_private_members @opacity_target = @opacity @opacity_duration = 0 end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- alias shaz_char_opacity_game_characterbase_update update def update update_opacity shaz_char_opacity_game_characterbase_update end #-------------------------------------------------------------------------- # * Opacity Update #-------------------------------------------------------------------------- def update_opacity return if @opacity_duration == 0 d = @opacity_duration @opacity = (@opacity * (d - 1) + @opacity_target) / d @opacity_duration -= 1 end #-------------------------------------------------------------------------- # * Opacity Update #-------------------------------------------------------------------------- def change_opacity(opacity, duration) @opacity_target = opacity @opacity_duration = duration endend
If you want this guy to go from invisible to fully opaque, then you'd do a Set Move Route, change the opacity to 0, set the graphic, then do the Script call to change opacity to 255 in however many frames you want.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top