Class AnimationLayerComponent
- Namespace
- SharpPluginLoader.Core.Components
- Assembly
- SharpPluginLoader.Core.dll
Represents an instance of the cpAnimationLayer class.
public class AnimationLayerComponent : Component
- Inheritance
-
AnimationLayerComponent
- Inherited Members
Constructors
AnimationLayerComponent()
public AnimationLayerComponent()
AnimationLayerComponent(nint)
public AnimationLayerComponent(nint instance)
Parameters
instancenint
Properties
CurrentFrame
The current frame of the animation.
public ref float CurrentFrame { get; }
Property Value
MaxFrame
The frame count of the animation.
public ref float MaxFrame { get; }
Property Value
Owner
The owner of this animation layer.
public Entity? Owner { get; }
Property Value
Paused
Gets or sets whether the animation is paused.
public bool Paused { get; set; }
Property Value
Speed
The speed of the animation.
public ref float Speed { get; }
Property Value
Methods
DoAnimation(AnimationId, float, float, float, uint)
Forces the animation layer to do the given animation. This will interrupt the current animation.
public void DoAnimation(AnimationId id, float interpolationFrame = 0, float startFrame = 0, float speed = 1, uint attr = 0)
Parameters
idAnimationIdThe id of the animation
interpolationFramefloatThe amount of frames used to interpolate. 0 will auto-calculate the necessary frames
startFramefloatThe starting frame of the animation
speedfloatThe initial speed of the animation
attruintAdditional flags
DoAnimationSafe(AnimationId, float, float, float, uint)
Forces the animation layer to do the given animation. This will interrupt the current animation.
public void DoAnimationSafe(AnimationId id, float interpolationFrame = 0, float startFrame = 0, float speed = 1, uint attr = 0)
Parameters
idAnimationIdThe id of the animation
interpolationFramefloatThe amount of frames used to interpolate. 0 will auto-calculate the necessary frames
startFramefloatThe starting frame of the animation
speedfloatThe initial speed of the animation
attruintAdditional flags
Remarks
If the owner object of the animation layer this function is called on is an entity,
it will instead call the function dedicated to entities. Note that in that case the speed
parameter will be ignored.
LockSpeed(float)
Locks the speed of this animation layer.
public void LockSpeed(float speed)
Parameters
speedfloatThe speed to lock it to
Pause()
Pauses the animation layer.
public void Pause()
RegisterLmt(MotionList, uint)
Registers an LMT to this animation layer.
public void RegisterLmt(MotionList lmt, uint index)
Parameters
lmtMotionListThe lmt to register
indexuintThe index to register the lmt in. Must be less than 16
Exceptions
Resume()
Resumes the animation layer.
public void Resume()
UnlockSpeed()
Unlocks the speed of this animation layer.
public void UnlockSpeed()