LVNAuth Tutorials - Rotating sprites
There are a number of simple animations that can be done with sprites/images in LVNAuth and one of those types is rotation.
It's possible to apply a rotation animation to character sprites, objects, or dialog sprites. It's also possible to adjust the rotate speed.
Sprites can be moved clockwise or counterclockwise.
One way a rotation animation can be useful is if you have a fan in your visual novel and want to show it spin.
Other possible uses include: rotating a wind turbine, rotating a character to show that the character is dreaming, while simultaneously applying a fade-out effect.
Let's say you have a fan object named fan. Here is an example on how to rotate it clockwise.
<object_set_center: fan, 99, 200>
<object_rotate_speed: fan, 12, clockwise>
<object_start_rotating: fan>
Here are the explanations for each of the lines above:
<object_set_center: fan, 99, 200>
This command technically isn't required to make the sprite rotate, but it sets the position of the fan to X (horizontal) coordinate of 99 and Y (vertical) coordinate of 200.
<object_rotate_speed: fan, 12, clockwise>
This will prepare the rotation animation by configuring it to rotate the fan object clockwise with a speed of 12%. The speed range is from 1 to 100; the higher the number, the faster the rotation.
<object_start_rotating: fan>
This will cause the rotation animation to start. Without this line, the rotation animation will not start. All the commands above this one that we've seen so far are used to configure the rotation animation, but this is the command that will actually start the rotation animation.
It's important to note that a sprite has to be visible before it can be rotated.
Use <character_show>
or <object_show>
or <dialog_sprite_show>
to make a sprite visible.
For example:
<object_show: fan>
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 rotation animation, consider using the command <object_rotate_delay>
along with the other commands that we've already looked at on this page.
That command will let you slow down a rotation 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 object sprites, you can also move character and dialog sprites.
All the commands for movement animations are available by clicking the Wizard button in LVNAuth.
Last updated: Fri 26 January 2024