new Loader(basePathopt)
todoc
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
basePath |
String |
<optional> |
'/' |
Extends
Members
(static, constant) AUDIO :String
The status of the loader
Properties:
Name | Type | Description |
---|---|---|
AUDIO |
(static, constant) IMG :String
The status of the loader
Properties:
Name | Type | Description |
---|---|---|
IMG |
basePath :String
The base path of the loader
(readonly) loadQueue :Array
The loading queue of the loader
(readonly) setPathList :Array
List of functions to set the queued element's src
(readonly) status :String
The status of the loader
Methods
add(type, path) → (nullable) {*}
Adds an item to the loading queue
Parameters:
Name | Type | Description |
---|---|---|
type |
String | |
path |
String |
Returns:
*addAudio(path) → {Audio}
Adds an audio to the loading queue
Parameters:
Name | Type | Description |
---|---|---|
path |
String |
Returns:
AudioaddEventListener(type, listener) → {EventTarget}
Adds a listener to the specified event
Parameters:
Name | Type | Description |
---|---|---|
type |
String | |
listener |
function |
- Inherited From:
- Source:
Returns:
EventTargetthis
addImage(path) → {Image}
Adds an image to the loading queue
Parameters:
Name | Type | Description |
---|---|---|
path |
String |
Returns:
ImagedispatchEvent(type) → {EventTarget}
Dispatches an Event at the specified EventTarget
Parameters:
Name | Type | Description |
---|---|---|
type |
String |
- Inherited From:
- Source:
Returns:
EventTargetthis
eachEventListener(type, callback) → {EventTarget}
Executes a provided function once per event listener
Parameters:
Name | Type | Description |
---|---|---|
type |
String | |
callback |
function |
- Inherited From:
- Source:
Returns:
EventTargetthis
emit(type) → {EventTarget}
Dispatches an Event at the specified EventTarget
Parameters:
Name | Type | Description |
---|---|---|
type |
String |
- Inherited From:
- Source:
- See:
Returns:
EventTargetthis
hasEventListener(type) → {Boolean}
Determines if the eventTarget has eventListeners of the given type
Parameters:
Name | Type | Description |
---|---|---|
type |
String |
- Inherited From:
- Source:
Returns:
Booleanload(type, path, callbackopt) → (nullable) {*}
Loads an item
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
type |
String | ||
path |
String | ||
callback |
function |
<optional> |
Returns:
*loadAudio(path, callbackopt, autoLoadopt) → {Audio}
Loads an audio
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
path |
String | ||
callback |
function |
<optional> |
|
autoLoad |
Boolean |
<optional> |
Returns:
AudioloadImage(path, callbackopt, autoLoadopt) → {Image}
Loads an image
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
path |
String | ||
callback |
function |
<optional> |
|
autoLoad |
Boolean |
<optional> |
Returns:
Imageoff(type, listener) → {EventTarget}
Removes a listener from the specified event
Parameters:
Name | Type | Description |
---|---|---|
type |
String | |
listener |
function |
- Inherited From:
- Source:
- See:
Returns:
EventTargetthis
offAll() → {EventTarget}
Removes all listeners
- Inherited From:
- Source:
- See:
Returns:
EventTargetthis
on(type, listener) → {EventTarget}
Adds a listener to the specified event
Parameters:
Name | Type | Description |
---|---|---|
type |
String | |
listener |
function |
- Inherited From:
- Source:
- See:
Returns:
EventTargetthis
remove(item) → (nullable) {*}
Removes an item from the loading queue
Parameters:
Name | Type | Description |
---|---|---|
item |
* |
Returns:
*removeAllEventListeners() → {EventTarget}
Removes all listeners
- Inherited From:
- Source:
Returns:
EventTargetthis
removeEventListener(type, listener) → {EventTarget}
Removes a listener from the specified event
Parameters:
Name | Type | Description |
---|---|---|
type |
String | |
listener |
function |
- Inherited From:
- Source:
Returns:
EventTargetthis
toString() → {String}
Returns the EventTarget string value
- Inherited From:
- Source: