Interface ResourceFactory
interface ResourceFactory { createAudioAsset(id: string,
assetPath: string,
duration: number,
system: AudioSystem,
loop: boolean,
hint: AudioAssetHint,
offset?: number): AudioAsset; createAudioPlayer(system: AudioSystem): AudioPlayer; createBinaryAsset?(id: string,
assetPath: string): BinaryAsset; createGlyphFactory(fontFamily: string | string[],
fontSize: number,
baselineHeight?: number,
fontColor?: string,
strokeWidth?: number,
strokeColor?: string,
strokeOnly?: boolean,
fontWeight?: FontWeightString): GlyphFactory; createImageAsset(id: string,
assetPath: string,
width: number,
height: number): ImageAsset; createScriptAsset(id: string,
assetPath: string,
exports?: string[]): ScriptAsset; createSurface(width: number,
height: number): Surface; createTextAsset(id: string,
assetPath: string): TextAsset; createVectorImageAsset?(id: string,
assetPath: string,
width: number,
height: number,
hint?: VectorImageAssetHint): VectorImageAsset; createVectorImageAssetFromString?(id: string,
assetPath: string,
data: string): VectorImageAsset; createVideoAsset(id: string,
assetPath: string,
width: number,
height: number,
system: VideoSystem,
loop: boolean,
useRealSize: boolean): VideoAsset; } Methods
createAudioAsset
- createAudioAsset(id, assetPath, duration, system, loop, hint, offset?): AudioAsset
Parameters
- id: string
- assetPath: string
- duration: number
- system: AudioSystem
- loop: boolean
- hint: AudioAssetHint
Optional
offset: number
createAudioPlayer
- createAudioPlayer(system): AudioPlayer
Optional
createBinaryAsset
- createBinaryAsset(id, assetPath): BinaryAsset
Parameters
- id: string
- assetPath: string
createGlyphFactory
- createGlyphFactory(fontFamily, fontSize, baselineHeight?, fontColor?, strokeWidth?, strokeColor?, strokeOnly?, fontWeight?): GlyphFactory
Parameters
- fontFamily: string | string[]
- fontSize: number
Optional
baselineHeight: numberOptional
fontColor: stringOptional
strokeWidth: numberOptional
strokeColor: stringOptional
strokeOnly: booleanOptional
fontWeight: FontWeightString
createImageAsset
- createImageAsset(id, assetPath, width, height): ImageAsset
Parameters
- id: string
- assetPath: string
- width: number
- height: number
createScriptAsset
- createScriptAsset(id, assetPath, exports?): ScriptAsset
Parameters
- id: string
- assetPath: string
Optional
exports: string[]
createSurface
- createSurface(width, height): Surface
Parameters
- width: number
- height: number
createTextAsset
- createTextAsset(id, assetPath): TextAsset
Parameters
- id: string
- assetPath: string
Optional
createVectorImageAsset
- createVectorImageAsset(id, assetPath, width, height, hint?): VectorImageAsset
Optional
createVectorImageAssetFromString
- createVectorImageAssetFromString(id, assetPath, data): VectorImageAsset
Parameters
- id: string
- assetPath: string
- data: string
createVideoAsset
- createVideoAsset(id, assetPath, width, height, system, loop, useRealSize): VideoAsset
Parameters
- id: string
- assetPath: string
- width: number
- height: number
- system: VideoSystem
- loop: boolean
- useRealSize: boolean
リソースの生成を行うインターフェース。
このクラス (の実装クラス) のインスタンスはエンジンによって生成される。ゲーム開発者が生成する必要はない。 またこのクラスの各種アセット生成メソッドは、エンジンによって暗黙に呼び出されるものである。 通常ゲーム開発者が呼び出す必要はない。