Cocos Creator API

1.2.0

Cocos Creator is a highly customizable game development tool that utilizes the power of cocos2d-x.

url

模块: cc

属性(properties)

_rawAssets Object private readOnly

The base url of raw assets.

_builtinRawAssets Object private readOnly

The base url of builtin raw assets.

There are no properties that match your current filter settings. You can change your filter settings in the index section on this page. index

方法

raw
(
  • url
)
String

Returns the url of raw assets, you will only need this if the raw asset is inside the "resources" folder.

名称 类型 描述
url String

返回:

类型: String

示例:

---
var url = cc.url.raw("textures/myTexture.png");
console.log(url);   // "resources/raw/textures/myTexture.png"

builtinRaw
(
  • url
)
String

Returns the url of builtin raw assets. This method can only used in editor.

名称 类型 描述
url String

返回:

类型: String

示例:

---
var url = cc.url.builtinRaw("textures/myTexture.png");
console.log(url);   // "resources/default-raw/textures/myTexture.png"

There are no methods that match your current filter settings. You can change your filter settings in the index section on this page. index