TextureImageStore


Interface for a callback to allow the caller to provide a particular UIImage corresponding to a client-provided texture ID.

Summary

Public functions

operator UIImage?
get(clientTextureId: String)

Retrieve a UIImage for the given texture ID.

N

Public functions

get

operator fun get(clientTextureId: String): UIImage?

Retrieve a UIImage for the given texture ID. This may be called synchronously during drawing, so loading of texture files from disk and decoding them into UIImage objects should be done on initialization. The result is expected to be cached by consumers, so this should return a deterministic result for a given input.

For rendering, this currently must return a UIImage wrapping a CGImage, that is, one where the underlying bitmap is pre-loaded.

Textures can be disabled by having this function always return null. null should also be returned when a texture can not be loaded. If null is returned, the texture layer in question should be ignored, allowing for graceful fallback. It's recommended that implementations log when a texture can not be loaded.

Returns
UIImage?

The texture image, if any, associated with the given ID.