LVNAuth Tutorials - Fading sprites
There are a number of simple animations that can be done with sprites in LVNAuth and one of those is fading. By sprites, I mean images.
It's possible to apply a fade in or fade out animation to character sprites, objects, or dialog sprites. It's even possible to adjust the fade-speed.
One common use of fading in is when you want to introduce a character on the screen.
Here is an example script to make a character, with the alias theo, show up on the screen.
<character_fade_current_value: theo, 0>
<character_fade_speed: theo, 35, fade in>
<character_fade_until: theo, 255>
<character_start_fading: theo>
Here is a breakdown on what each line does.
Command | Explanation |
---|---|
<character_fade_current_value: theo, 0> |
This will set the starting fade position to zero, which means fully transparent. Since we're going to fade-in the character gradually, it makes sense to start with 0 opacity. |
<character_fade_speed: theo, 35, fade in> |
The fade speed is being set to 35% (out of 100). 1 is the slowest, 100 is the fastest. |
<character_fade_until: theo, 255> |
Specifies when to stop fading in. 255 means full opacity, 0 means fully transparent (0 to 255). So here we're telling it to fade in until the sprite is fully opaque. |
<character_start_fading: theo> |
This will start the fading animation. Without this line, the fading animation won't begin. |
Note: The sprite has to be visible before starting the fade animation; otherwise the fade animation won't work. You can make a character sprite visible by using the command <character_show>
. For example: <character_show: theo>
.
So that's how a fade-in animation is done.
Objects and Dialog Sprites have the same kind of commands.
For example: <object_fade_speed>
and <dialog_sprite_fade_speed>
.
Fading-out is similar to fading-in with some slight differences.
<character_fade_current_value: theo, 255>
<character_fade_speed: theo, 35, fade out>
<character_fade_until: theo, 0>
<character_start_fading: theo>
In the script above, we're starting at full opacity (value of 255) and we're fading-out until it reaches 0 (zero) opacity.
All the commands for fading-in and fading-out are available by clicking the Wizard button in LVNAuth.
Last updated: Thu 25 January 2024