Contents

init(dictionaryLiteral:)

Creates an animation library from a variadic list of key-value pairs.

Declaration

init(dictionaryLiteral elements: (String, AnimationResource)...)

Parameters

  • elements:

    A list of key-value pairs that make up the dictionary. Each key is a unique animation name, and each value is an animation resource.

Discussion

Use the ExpressibleByDictionaryLiteral initializer by directly assigning the library to a dictionary literal.

let animationLibrary: AnimationLibraryComponent = [
    "idle": idleAnimation,
    "walk": walkAnimation
]

See Also

Creating an animation library component