-
Notifications
You must be signed in to change notification settings - Fork 0
Runtime (AnimSpriteRenderComponent)
First, there is two options to show sprites.
- A2S native component (only Win64 supported:other platforms are not tested)
- Using Paper2D (UnrealEngine builtin plugin for sprites->Visit here)
Usually this is the better option.
BP_SideViewPawn (side view) and BP_QuarterViewPawn (quarter view) are provided as samples.
-
Attach UAnimSpriteRenderComponent to your actor
-
Setup its properties
See "Features" below for details. -
Set AnimSpriteSet to it
- AWSD : move
- Space : jump
- P : switch character
- L : switch lighting
- AWSD : move
- P : switch character
A callback is dispatched when the animation playback is complete.
To receive callback, bind an event to OnAnimationFinished delegate.
The demo blueprint BP_SideViewPawn is a good sample of its use.
"AutoRotate" option of AnimSpriteRenderComponent determines the appropriate sprite "orientation" (expressed as an image index) from the Actor's orientation. It is intended to be used with Billboard materials.
QuaterViewMap is a sample of this feature.
The Billboard materials (MI_AnimSprite_Billboard / MI_AnimSprite_Toon_Billboard) controls the mesh so that it always faces the camera.
This is useful when the camera is facing a variable or skewed direction.
The non-Billboard materials (MI_AnimSprite / MI_AnimSprite_Toon) controls only the size of the Quad.
This is a better fit for SideView.
The limited deformation caused by the shader makes it easier to keep the socket position consistent.
Toon materials (MI_AnimSprite_Toon/ MI_AnimSprite_Toon_Billboard) cannot directly obtain information about light sources other than parallel light sources, and lighting is performed through the MaterialParameterCollection (MPC_ToonLighting).
The best method for setting up light sources is likely to vary from application to application, but BP_LightFinder should serve as a sample.
For non-Toon materials (MI_AnimSprite / MI_AnimSprite_Billboard), no special precautions are required abount lighting.