@vaguevoid/fiasco / ecs/resources / Text
Type Alias: Text
Text =
PendingText
|LoadedText
|EngineText
|FailedText
Defined in: src/ecs/resources.ts:339
Represents a discriminate union of all the possible Text states.
Use the kind
field to narrow the type.
ts
import { TextAssetManager } from '@vaguevoid/fiasco'
function system(textAssetManager: TextAssetManager) {
const text = textAssetManager.getTextById(id)
if (text?.kind === 'pending') {
// access to pending fields available now
console.log(text.textPath)
}
}