url Class

Module: cc Parent Module: cc

Index

Properties
Methods
  • raw Returns the url of raw assets, you will only need this if the raw asset is inside the "resources" folder.
  • builtinRaw Returns 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
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
Examples
---
var url = cc.url.builtinRaw("textures/myTexture.png");
console.log(url);   // "resources/default-raw/textures/myTexture.png"

results matching ""

    No results matching ""