LazyCharacterResourceLookup

class LazyCharacterResourceLookup(val root: String = "", val extension: String = ".png") : CharacterResourceLookup

Provides an interface for a lookup for Character resources. A root can be specified it the resource default location is not the top level resource directory. An extension can be optionally specified for image format (.png is used as default). Unless overridden this will return a resource key for a character in the following format:

When a character variation is not specified: name-emotion.extension When a character variation is specified: name-variation-emotion.extension

Constructors

Link copied to clipboard
constructor(root: String = "", extension: String = ".png")

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun getKey(character: Character): String

Get a key for a character.

open override fun getKey(character: Character, emotion: Emotion): String

Get a key for a character and emotion.

Link copied to clipboard
fun registerResource(character: Character, key: String)

Register a resource with a specified character and key. This will use the characters emotion.

fun registerResource(characterLookupState: CharacterLookupState, key: String)

Register a resource with a specified characterLookupState.

fun registerResource(character: Character, emotion: Emotion, key: String)

Register a resource with a specified character, emotion and key.