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