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
instance
nint
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
id
AnimationIdThe id of the animation
interpolationFrame
floatThe amount of frames used to interpolate. 0 will auto-calculate the necessary frames
startFrame
floatThe starting frame of the animation
speed
floatThe initial speed of the animation
attr
uintAdditional 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
id
AnimationIdThe id of the animation
interpolationFrame
floatThe amount of frames used to interpolate. 0 will auto-calculate the necessary frames
startFrame
floatThe starting frame of the animation
speed
floatThe initial speed of the animation
attr
uintAdditional 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
speed
floatThe 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
lmt
MotionListThe lmt to register
index
uintThe 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()