Constructor
new AppResourcePoolComponent()
The resource manager to use duplicate resources, prevent to create multiple times.
Extends
Members
active :Boolean
Active or deactive component.
Type:
- Boolean
- Overrides:
- Source:
app :THING.App
Get application.
Type:
- Overrides:
- Source:
object :THING.BaseObject
Get object.
Type:
- Overrides:
- Source:
onActiveChange :OnActiveChangeComponentCallback
When active change callback function.
Type:
- Overrides:
- Source:
onAfterAdd :OnAfterAddComponentCallback
After add.
Type:
- Overrides:
- Source:
onAfterAddChild :OnAddChildComponentCallback
When after add child callback function.
Type:
- Overrides:
- Source:
onAfterRemove :OnAfterRemoveComponentCallback
After remove.
Type:
- Overrides:
- Source:
onAfterRemoveChild :OnRemoveChildComponentCallback
When after remove child callback function.
Type:
- Overrides:
- Source:
onBeforeAdd :OnBeforeAddComponentCallback
Before add.
Type:
- Overrides:
- Source:
onBeforeAddChild :OnAddChildComponentCallback
When before add child callback function.
Type:
- Overrides:
- Source:
onBeforeRemove :OnBeforeRemoveComponentCallback
Before remove.
Type:
- Overrides:
- Source:
onBeforeRemoveChild :OnRemoveChildComponentCallback
When before remove child callback function.
Type:
- Overrides:
- Source:
onCopy :OnCopyComponentCallback
When copy callback function.
Type:
- Overrides:
- Source:
onExport :OnExportComponentCallback
When export data.
Type:
- Overrides:
- Source:
onImport :OnImportComponentCallback
When import data.
Type:
- Overrides:
- Source:
onInit :OnInitComponentCallback
When initialize callback function.
Type:
- Overrides:
- Source:
onLoadResource :OnLoadResourceComponentCallback
When load resource callback function.
Type:
- Overrides:
- Source:
onParentChange :OnParentChangeComponentCallback
When change parent callback function.
Type:
- Overrides:
- Source:
onRefresh :OnRefreshComponentCallback
When refresh callback function.
Type:
- Overrides:
- Source:
onResize :OnResizeComponentCallback
When resize callback function.
Type:
- Overrides:
- Source:
onUnloadResource :OnUnloadResourceComponentCallback
When unload resource callback function.
Type:
- Overrides:
- Source:
onUpdate :OnUpdateComponentCallback
When update callback function.
Type:
- Overrides:
- Source:
onVisibleChange :OnVisibleChangeComponentCallback
When visible change callback function.
Type:
- Overrides:
- Source:
Methods
load(url, options) → {Promise}
Load scene file
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
String | Object | The load URL or options. | ||||||||||||||||||||||||||||||||||||
options |
Object | The load options.
Properties
|
Returns:
- A Promise that resolves when the loading is complete.
- Type
- Promise
loadImageTexture(url, sampler) → {THING.ImageTexture}
Load image texture from URL.
Parameters:
Name | Type | Description |
---|---|---|
url |
String | The resource url. |
sampler |
LoadTextureResourceSamplerInfo | The sampler info. |
Returns:
- Type
- THING.ImageTexture
Example
let image = THING.App.current.loadImageTexture('./flower.png');
await image.waitForComplete();
console.log(image);
loadImageTextureAsync(url, sampler) → {Promise.<any>}
Load image texture from URL in async mode.
Parameters:
Name | Type | Description |
---|---|---|
url |
String | The resource url. |
sampler |
LoadTextureResourceSamplerInfo | The sampler info. |
Returns:
- Type
- Promise.<any>
Example
let image = await THING.App.current.loadImageTextureAsync('./flower.png');
console.log(image);
loadPlugin(url, options) → {Promise}
Load plugin
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
String | Object | The load URL or options. | |||||||||||||||
options |
Object | The load options.
Properties
|
Returns:
- Type
- Promise
onAdd(object)
When add component.
Parameters:
Name | Type | Description |
---|---|---|
object |
THING.BaseObject | The object. |
- Overrides:
- Source:
onRemove()
When remove component.
- Overrides:
- Source: