Hollow Knight: Silksong

Details

Last Updated
last week
First Uploaded
last week
Downloads
4.5K
Likes
1
Size
29KB
Dependency string
silksong_modding-UnityHelper-1.1.0
Dependants

Categories

UnityHelper

Library containing utility functions associated with Unity objects.

Usage Examples

Custom Animations

The functions in the Tk2dUtil class can be used to create custom animations.

For simple one-off animations, you can create animation clips directly:

Sprite[] frames = [/* load some sprites with the sprite utils */];
// (You can also use Texture2Ds)

tk2dSpriteAnimationClip
    myAnim = Tk2dUtil.CreateTk2dAnimationClip("My Anim", fps: 10, frames),
    myLoopingAnim = Tk2dUtil.CreateTk2dAnimationClip("My Loop Anim", fps: 10, frames, tk2dSpriteAnimationClip.WrapMode.Loop);

If you need finer control over the sprite data, animations, or frames, you can also create a sprite collection and then build frames and animations manually:

Sprite[] sprites = [/* load some sprites with the sprite utils */];
// (You can also use Texture2Ds)

tk2dSpriteCollectionData collection = Tk2dUtil.CreateTk2dSpriteCollection(sprites);

tk2dSpriteAnimationFrame[] frames = [
    collection.CreateFrame(sprites[0].name, triggerEvent: true),
    .. collection.CreateFrames(sprites.Skip(1).Select(x => x.name))
];

tk2dSpriteAnimationClip myAnim = new() {
    name = "My Anim",
    fps = 10,
    wrapMode = tk2dSpriteAnimationClip.WrapMode.Once,
    frames = frames
};
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.