LVNAuth Tutorials - Moving sprites
There are a number of simple animations that can be done with sprites/images in LVNAuth and one of those types is movement.
It's possible to apply a movement animation to character sprites, objects, or dialog sprites. It's also possible to adjust the speed.
Sprites can be moved horizontally, vertically, or diagonally.
One way movements can be useful is when you want to introduce a character. For example, you can have your character move from left to right and then have it stop, before it starts to talk.
Let's say you have a character named Theo. Here is an example on how to move the character's image/sprite from left to right and then have it stop at a specific location:
<character_set_position_x: theo, before start of display>
<character_set_position_y: theo, bottom of display>
<character_move: theo, 6, right, 0, up>
<character_stop_movement_condition: theo, left, 100>
<character_start_moving: theo>
Here are the explanations for each of the lines above:
<character_set_position_x: theo, before start of display>
We're setting the horizontal position of the character's image to before the left side of the visual novel. This means that the character's image will be invisible because it won't be within the boundries of the visual novel's display. The plan is to move the character from left to right, so with this command we're setting up the initial position to prepare it for a movement animation.
<character_set_position_y: theo, bottom of display>
We're setting the initial vertical position of the character's image. This will make the bottom of the image be at the bottom of the visual novel.
<character_move: theo, 6, right, 0, up>
We're configuring the move animation to move the character's image towards the right by 6 pixels each frame. Increase this number to make the movement faster or decrease it to make it move slower.
<character_stop_movement_condition: theo, left, 100>
This will cause the character's image to stop moving when the left side of the image reaches position X of 100. Without this command, the character will keep moving towards the right, without stopping. It will even continue beyond the visual novel's display. So we need to have this command to make the movement animation eventually stop where we want.
<character_start_moving: theo>
This will cause the movement animation to start. Without this line, the movement animation will not start. All the commands above this one that we've seen so far are used to configure what the movement will do, but this is the command that will actually start the movement animation.
It's important to note that a sprite has to be visible before it can be moved.
Use <character_show>
or <object_show>
or <dialog_sprite_show>
to make a sprite visible.
For example:
<character_show: theo>
Here is a quick example that shows how to configure a diagonal movement animation.
<character_move: theo, 4, right, 4, up>
This will configure the animation to go 4 pixels right and 4 pixels up on each frame.
To create an extra-slow movement animation, consider using the command <character_move_delay>
along with the other commands that we've already looked at on this page.
That command will let you slow down a movement animation. You would need to experiment with the delay values to find a suitable delay setting for your sprite/image, depending on what you want to achieve in your visual novel.
Aside from character sprites, you can also move objects and dialog sprites.
All the commands for movement animations are available by clicking the Wizard button in LVNAuth.
Last updated: Thu 25 January 2024