url Class
Index
Properties
- _rawAssets- ObjectThe base url of raw assets.
- _builtinRawAssets- ObjectThe base url of builtin raw assets.
Methods
- rawReturns the url of raw assets, you will only need this if the raw asset is inside the "resources" folder.
- builtinRawReturns the url of builtin raw assets. This method can only used in editor.
Details
Properties
_rawAssets
The base url of raw assets.
| meta | description | 
|---|---|
| Type | Object | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/url.js:38 | 
_builtinRawAssets
The base url of builtin raw assets.
| meta | description | 
|---|---|
| Type | Object | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/url.js:46 | 
Methods
raw
Returns the url of raw assets, you will only need this if the raw asset is inside the "resources" folder.
| meta | description | 
|---|---|
| Returns | String | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/url.js:66 | 
Parameters
- urlString
Examples
---
var url = cc.url.raw("textures/myTexture.png");
console.log(url);   // "resources/raw/textures/myTexture.png"
builtinRaw
Returns the url of builtin raw assets. This method can only used in editor.
| meta | description | 
|---|---|
| Returns | String | 
| Defined in | https:/github.com/cocos-creator/engine/blob/master/cocos2d/core/platform/url.js:94 | 
Parameters
- urlString
Examples
---
var url = cc.url.builtinRaw("textures/myTexture.png");
console.log(url);   // "resources/default-raw/textures/myTexture.png"
