1. 程式人生 > >cocos2d-JS engine--cc模組 概述

cocos2d-JS engine--cc模組 概述



 一、模組 cc


       Cocos 引擎的主要名稱空間,引擎程式碼中所有的類,函式,屬性和常量都在這個名稱空間中定義。

二、常用API 

--cc.Acceleration

    型別:裝置重力感測器傳遞的各個軸的資料。


--cc.Action

    型別:Action 類是所有動作型別的基類。


--cc.ActionEase

    型別:所有緩動動作基類,用於修飾 ActionInterval。

    繼承於 ActionInterval


--cc.ActionInstant

    型別:即時動作,這種動作立即就會執行,

    繼承自 FiniteTimeAction。


--cc.ActionInterval

    型別:時間間隔動作,這種動作在已定時間內完成,

    繼承 FiniteTimeAction。


--cc.ActionManager

    型別:cc.ActionManager 是可以管理動作的單例類。

    通常你並不需要直接使用這個類,99%的情況您將使用 CCNode 的介面。

    但也有一些情況下,您可能需要使用這個類。

    例如:

        當你想要執行一個動作,但目標不是 CCNode 型別時。

        當你想要暫停/恢復動作時。

--cc.AffineTransform

    型別:cc.AffineTransform 類代表一個仿射變換矩陣。它基本上是由平移旋轉,縮放轉變所組成。

    請不要直接使用它的構造,請使用 cc.affineTransformMake 函式代替。

--cc.Animation

    型別:

    Animation 元件用於播放動畫。你能指定動畫剪輯到動畫元件並從指令碼控制播放。


    Animation 提供了一系列可註冊的事件:


        play : 開始播放時

        stop : 停止播放時

        pause : 暫停播放時

        resume : 恢復播放時

        lastframe : 假如動畫迴圈次數大於 1,當動畫播放到最後一幀時

        finished : 動畫播放完成時


--cc.AnimationClip

    型別:動畫剪輯,用於儲存動畫資料。

    繼承於 Asset


--cc.AnimationNode

    型別:動畫曲線的集合,根據當前時間計算出每條曲線的狀態。

    繼承於 AnimationNodeBase


--cc.AnimationNodeBase

    型別:所有播放動畫的抽象介面。

    繼承於 Playable


--cc.AnimationState

    型別:AnimationState 完全控制動畫播放過程。

    大多數情況下 動畫元件 是足夠和易於使用的。如果您需要更多的動畫控制介面,請使用 AnimationState。

    繼承於 AnimationNode

--cc.ArmatureDisplay

    型別:DragonBones 骨骼動畫

    (Armature Display 具有對骨骼資料的引用並且儲存了骨骼例項的狀態, 它由當前的骨骼動作,slot 顏色,和可見的 slot attachments 組成。

    多個 Armature Display 可以使用相同的骨骼資料,其中包括所有的動畫,面板和 attachments。)

--cc.Asset

    型別:資源基類,該類可以被例項化。

    您可能需要重寫:


    createNode

    cc.Object._serialize

    cc.Object._deserialize

    繼承於 RawAsset


--cc.AudioClip

    型別:繼承於 RawAsset


--cc.AudioSource

    型別:音訊源元件,能對音訊剪輯。

    繼承於 Component


--cc.BitmapFont

    型別:點陣圖字型資源類。

    繼承於 RawAsset


--cc.BlendFunc

    型別:影象的混合方式。


--cc.BoxCollider

    型別:包圍盒碰撞元件。

    繼承於 Component

--cc.Button

    型別:按鈕元件。可以被按下,或者點選。

    按鈕可以通過修改 Transition 來設定按鈕狀態過渡的方式:

    -Button.Transition.NONE // 不做任何過渡

    -Button.Transition.COLOR // 進行顏色之間過渡

    -Button.Transition.SPRITE // 進行精靈之間過渡

    -Button.Transition.SCALE // 進行縮放過渡

    按鈕可以繫結事件(但是必須要在按鈕的 Node 上才能繫結事件):

    // 以下事件可以在全平臺上都觸發

    -cc.Node.EventType.TOUCH_START // 按下時事件

    -cc.Node.EventType.TOUCH_Move // 按住移動後事件

    -cc.Node.EventType.TOUCH_END // 按下後鬆開後事件

    -cc.Node.EventType.TOUCH_CANCEL // 按下取消事件

    // 以下事件只在 PC 平臺上觸發

    -cc.Node.EventType.MOUSE_DOWN // 滑鼠按下時事件

    -cc.Node.EventType.MOUSE_MOVE // 滑鼠按住移動後事件

    -cc.Node.EventType.MOUSE_ENTER // 滑鼠進入目標事件

    -cc.Node.EventType.MOUSE_LEAVE // 滑鼠離開目標事件

    -cc.Node.EventType.MOUSE_UP // 滑鼠鬆開事件

    -cc.Node.EventType.MOUSE_WHEEL // 滑鼠滾輪事件

--cc.CallbacksInvoker

    型別:CallbacksInvoker 用來根據 Key 管理並呼叫回撥方法。

--cc.Canvas

    型別:: 作為 UI 根節點,為所有子節點提供視窗四邊的位置資訊以供對齊,另外提供螢幕適配策略介面,方便從編輯器設定。

    注:由於本節點的尺寸會跟隨螢幕拉伸,所以 anchorPoint 只支援 (0.5, 0.5),否則適配不同螢幕時座標會有偏差。

    繼承於 Component

--cc.CircleCollider

    型別:圓形碰撞元件

    繼承於 Component

--cc.CoffeeScript

    型別:CoffeeScript 資源類。

    繼承於 Asset

--cc.Collider

    型別:碰撞元件基類

    繼承於 Component

--cc.CollisionManager

    型別:一個簡單的碰撞元件管理類,用於處理節點之間的碰撞元件是否產生了碰撞,並呼叫相應回撥函式。


--cc.Color

    型別:

    cc.Color 用於表示顏色。

    它包含 RGBA 四個以浮點數儲存的顏色分量,每個的值都在 0 到 255 之間。

    您也可以通過使用 cc.color 的便捷方法來建立一個新的 Color。

    繼承於 ValueType


--cc.Component

    型別:所有附加到節點的基類。

    注意:不允許使用元件的子類構造引數,因為元件是由引擎建立的。

--cc.Component.EventHandler

    //Demo: Create new EventHandler

    var eventHandler = new cc.Component.EventHandler();

    eventHandler.target = newTarget;

    eventHandler.component = "MainMenu";

    eventHandler.handler = "OnClick";

    eventHandler.customEventData = "my data";

--cc.ContainerStrategy

    型別:cc.ContainerStrategy class is the root strategy class of container's scale strategy,

            it controls the behavior of how to scale the cc.container and cc.game.canvas object


--cc.ContentStrategy

    型別:cc.ContentStrategy class is the root strategy class of content's scale strategy,

    it controls the behavior of how to scale the scene and setup the viewport for the game

--cc.Details

    型別:包含反序列化時的一些資訊

--cc.Director

    型別: 注意:用 cc.director 代替 cc.Director。

            cc.director 一個管理你的遊戲的邏輯流程的單例物件。

            由於 cc.director 是一個單例,你不需要呼叫任何建構函式或建立函式,

            使用它的標準方法是通過呼叫:

            - cc.director.methodName();

            它建立和處理主視窗並且管理什麼時候執行場景。

            cc.director 還負責:

            - 初始化 OpenGL 環境。

            - 設定OpenGL畫素格式。(預設是 RGB565)

            - 設定OpenGL緩衝區深度 (預設是 0-bit)

            - 設定空白場景的顏色 (預設是 黑色)

            - 設定投影 (預設是 3D)

            - 設定方向 (預設是 Portrait)

            cc.director 設定了 OpenGL 預設環境

            - GL_TEXTURE_2D 啟用。

            - GL_VERTEX_ARRAY 啟用。

            - GL_COLOR_ARRAY 啟用。

            - GL_TEXTURE_COORD_ARRAY 啟用。

            cc.director 也同步定時器與顯示器的重新整理速率。

            特點和侷限性:

            - 將計時器 & 渲染與顯示器的重新整理頻率同步。

            - 只支援動畫的間隔 1/60 1/30 & 1/15。

--cc.EaseBounce

    型別:反彈緩動動作基類。

--cc.EaseElastic

    型別:彈性緩動動作基類。

--cc.EaseRateAction

    型別:擁有速率屬性的緩動動作基類。

--cc.EditBox

    型別:EditBox 元件,用於獲取使用者的輸入文字。


--cc.EqualToFrame

    型別:

    繼承於 ContainerStrategy

--cc.EqualToWindow

    型別:

    繼承於 EqualToFrame

--cc.Event

    型別:包含事件相關資訊的物件。

--cc.Event.EventAcceleration

    型別:加速度事件

--cc.Event.EventCustom

    型別:自定義事件

--cc.Event.EventKeyboard

    型別:鍵盤事件

--cc.Event.EventMouse

    型別:滑鼠事件型別

--cc.Event.EventTouch

    型別:觸控事件

--cc.EventListener

    型別:封裝使用者的事件處理邏輯。 注意:這是一個抽象類,開發者不應該直接例項化這個類,請參考 cc.EventListener.create

--cc.EventTarget

    型別:事件目標是事件觸發時,分派的事件物件,Node 是最常見的事件目標, 但是其他物件也可以是事件目標。


--cc.FiniteTimeAction

    型別:有限時間動作,這種動作擁有時長 duration 屬性。

--cc.Font

    型別:字型資源類。

    繼承於 RawAsset

--cc.Game

    型別:cc.game 是 Game 的例項,用來驅動整個遊戲。

--cc.Graphics

    型別:圖形相關

--cc.Intersection

    型別:輔助類,用於測試形狀與形狀是否相交

--cc.Label

    型別:文字標籤元件

--cc.LabelOutline

    型別:描邊效果元件,用於字型描邊,只能用於系統字型

    繼承於 Component

--cc.Layout

    型別:Layout 元件相當於一個容器,能自動對它的所有子節點進行統一排版。

    繼承於 Component

--cc.LoadingItems

    型別:

    LoadingItems 是一個載入物件佇列,可以用來輸送載入物件到載入管線中。

    請不要直接使用 new 構造這個類的物件,你可以使用 LoadingItems.create 來建立一個新的載入佇列,這樣可以允許我們的內部物件池回收並重利用載入佇列。 它有一個 map 屬性用來存放載入項,在 map 物件中已 url 為 key 值。

    每個物件都會包含下列屬性:

        id:該物件的標識,通常與 url 相同。

        url:路徑

        type: 型別,它這是預設的 URL 的副檔名,可以手動指定賦值。

        error:pipeline 中發生的錯誤將被儲存在這個屬性中。

        content: pipeline 中處理的臨時結果,最終的結果也將被儲存在這個屬性中。

        complete:該標誌表明該物件是否通過 pipeline 完成。

        states:該物件儲存每個管道中物件經歷的狀態,狀態可以是 Pipeline.ItemState.WORKING | Pipeline.ItemState.ERROR | Pipeline.ItemState.COMPLETE

        物件可容納其他自定義屬性。

        每個 LoadingItems 物件都會在 onComplete 回撥之後被銷燬,所以請不要持有它的引用並在結束回撥之後依賴它的內容執行任何邏輯,有這種需求的話你可以提前複製它的內容。

    繼承於 CallbacksInvoker

--cc.Mask

    型別:該元件被附加到的節點。元件總會附加到一個節點。

--cc.MotionStreak

    型別:運動軌跡,用於遊戲物件的運動軌跡上實現拖尾漸隱效果。

    繼承於 Component

--cc.Node

    型別:Cocos Creator 場景中的所有節點類。節點也繼承了 EventTarget,它允許節點發送事件。

    支援的節點事件,請參閱 Node.EventType。

--cc.NodePool

    型別:

    cc.NodePool 是用於管理節點物件的物件快取池。

    它可以幫助您提高遊戲效能,適用於優化物件的反覆建立和銷燬

    以前 cocos2d-x 中的 cc.pool 和新的節點事件註冊系統不相容,因此請使用 cc.NodePool 來代替。

    新的 NodePool 需要例項化之後才能使用,每種不同的節點物件池需要一個不同的物件池例項,這裡的種類對應於遊戲中的節點設計,一個 prefab 相當於一個種類的節點。

    在建立緩衝池時,可以傳入一個包含 unuse, reuse 函式的元件型別用於節點的回收和複用邏輯。

    一些常見的用例是:

    1.在遊戲中的子彈(死亡很快,頻繁建立,對其他物件無副作用)

    2.糖果粉碎傳奇中的木塊(頻繁建立)。 等等....

--cc.OriginalContainer

    型別:

    繼承於 ContainerStrategy

--cc.PageView

    型別:頁面檢視元件

    繼承於 ScrollView

--cc.PageViewIndicator

    型別:頁面檢視每頁標記元件

    繼承於 Component

--cc.ParticleSystem

    型別:

    Particle System base class.

    Attributes of a Particle System:


    emmision rate of the particles

    Gravity Mode (Mode A):

    gravity

    direction

    speed +- variance

    tangential acceleration +- variance

    radial acceleration +- variance

    Radius Mode (Mode B):

    startRadius +- variance

    endRadius +- variance

    rotate +- variance

    Properties common to all modes:

    life +- life variance

    start spin +- variance

    end spin +- variance

    start size +- variance

    end size +- variance

    start color +- variance

    end color +- variance

    life +- variance

    blending function

    texture


    cocos2d also supports particles generated by Particle Designer (http://particledesigner.71squared.com/).

    'Radius Mode' in Particle Designer uses a fixed emit rate of 30 hz. Since that can't be guarateed in cocos2d,

    cocos2d uses a another approach, but the results are almost identical.

    cocos2d supports all the variables used by Particle Designer plus a bit more:

    spinning particles (supported when using ParticleSystem)

    tangential acceleration (Gravity mode)

    radial acceleration (Gravity mode)

    radius direction (Radius mode) (Particle Designer supports outwards to inwards direction only)

    It is possible to customize any of the above mentioned properties in runtime. Example:

    示例:

    emitter.radialAccel = 15;

    emitter.startSpin = 0;

--cc.Pipeline

    型別:

    pipeline 描述了一系列的操作,每個操作都被稱為 pipe。

    它被設計來做載入過程的流程管理。所以 item 應該是 url,並且該 url 將是在處理中的每個 item 的身份標識。

    一個 item 列表可以在 pipeline 中流動,它將輸出載入項經過所有 pipe 之後的結果。

    它們穿過 pipeline 就像水在管子裡流動,將會按順序流過每個 pipe。

    最後當所有載入項都流出 pipeline 時,整個載入流程就結束了。

--cc.Pipeline.Downloader

    型別:


    The downloader pipe, it can download several types of files:


   1. Text

   2.Image

   3.Script

   4. Audio All unknown type will be downloaded as plain text. You can pass custom supported types in the constructor.

--cc.Pipeline.Loader

    型別:

    The loader pipe, it can load several types of files:


   1. Images

   2.JSON

   3.Plist

   4.Audio

   5.Font

   6.Cocos Creator scene It will not interfere with items of unknown type. You can pass custom supported types in the constructor

--cc.Playable

    型別:播放相關

--cc.PolygonCollider

    型別:多邊形碰撞元件

    繼承於 Component

--cc.Prefab

    型別:預製資源類。

    繼承於 Asset

--cc.ProgressBar

    型別:繼承於 Component

        進度條元件,可用於顯示載入資源時的進度。

        示例:

        // update progressBar

        update: function (dt) {

            var progress = progressBar.progress;

            if (progress > 0) {

                progress += dt;

            }

            else {

                progress = 1;

            }

            progressBar.progress = progress;

        }

--cc.ProportionalToFrame

    型別:繼承於 ContainerStrategy

--cc.ProportionalToWindow

    型別:繼承於 ProportionalToFrame

--cc.Quad2

    型別:

    屬性(properties)

    BYTES_PER_ELEMENT

--cc.Quad3

    型別:

    屬性(properties)

    BYTES_PER_ELEMENT


--cc.RawAsset

    型別:註冊用的資源基類。

    你可能要重寫:createNode (static)

--cc.Rect

    型別:通過位置和寬高定義的 2D 矩形。

    繼承於 ValueType

--cc.ResolutionPolicy

    型別:通過位置和寬高定義的 2D 矩形。

    繼承於 ValueType

--cc.RichText

    型別:富文字元件

    繼承於 Component

--cc.Scene

    型別:cc.Scene 是 cc.Node 的子類,僅作為一個抽象的概念。

    cc.Scene 和 cc.Node 有點不同,使用者不應直接修改 cc.Scene。


--cc.SceneAsset

    型別:場景資源類。

--cc.Scheduler

    型別:

        Scheduler 是負責觸發回撥函式的類。

        通常情況下,建議使用 cc.director.getScheduler() 來獲取系統定時器。

        有兩種不同型別的定時器:

        - update 定時器:每一幀都會觸發。您可以自定義優先順序。

        - 自定義定時器:自定義定時器可以每一幀或者自定義的時間間隔觸發。

        如果希望每幀都觸發,應該使用 update 定時器,使用 update 定時器更快,而且消耗更少的記憶體。

--cc.ScrollView

    型別:滾動檢視元件

    繼承於 Component

--cc.Scrollbar

    型別:滾動條元件

    繼承於 Component

--cc.Size

    型別:cc.Size 是 size 物件的類。

          請不要使用它的建構函式建立的 size,

          使用 size 別名函式。

          它不久將被取消,請使用cc.Vec2代替。

--cc.Slider

    型別:滑動器元件

--cc.Sprite

    型別:

    該元件用於在場景中渲染精靈。

    示例:

    // Create a new node and add sprite components.

     var node = new cc.Node("New Sprite");

     var sprite = node.addComponent(cc.Sprite);

     node.parent = this.node;

--cc.SpriteAtlas

    型別:精靈圖集資源類。

    繼承於 RawAsset

--cc.SpriteDistortion

    型別:扭曲效果元件,用於改變SIMPLE型別sprite的渲染,只有當sprite元件已經新增後,才能起作用.

    繼承於 Component


--cc.SpriteFrame

    型別:

    一個 SpriteFrame 包含:

    紋理:會被 Sprite 使用的 Texture2D 物件。

    矩形:在紋理中的矩形區域。

    // load a cc.SpriteFrame with image path (Recommend)

        var self = this;

        var url = "test assets/PurpleMonster";

        cc.loader.loadRes(url, cc.SpriteFrame, function (err, spriteFrame) {

         var node = new cc.Node("New Sprite");

         var sprite = node.addComponent(cc.Sprite);

         sprite.spriteFrame = spriteFrame;

         node.parent = self.node

        });

--cc.SystemEvent

    型別:系統事件,它目前支援按鍵事件和重力感應事件

    繼承於 EventTarget

--cc.TMXObject

    型別:渲染 tmx object。

--cc.TTFFont

    型別:TTF 字型資源類。

    繼承於 Asset


--cc.Tex2F

    型別:

    屬性(properties)

    BYTES_PER_ELEMENT


--cc.TextAsset

    繼承於 Asset

    型別:文字資源類。


--cc.Texture2D

    型別:

    This class allows to easily create OpenGL or Canvas 2D textures from images, text or raw data.

    The created cc.Texture2D object will always have power-of-two dimensions.

    Depending on how you create the cc.Texture2D object, the actual image area of the texture might be smaller than the texture dimensions

    i.e. "contentSize" != (pixelsWide, pixelsHigh) and (maxS, maxT) != (1.0, 1.0).

    Be aware that the content of the generated textures will be upside-down!

    繼承於 RawAsset

--cc.TextureAtlas

    型別:

    A class that implements a Texture Atlas.

    Supported features:

    The atlas file can be a PNG, JPG.

    Quads can be updated in runtime

    Quads can be added in runtime

    Quads can be removed in runtime

    Quads can be re-ordered in runtime

    The TextureAtlas capacity can be increased or decreased in runtime.

--cc.TiledLayer

    型別:渲染 TMX layer。

--cc.TiledMap

    型別:在場景中渲染一個 tmx 格式的 Tile Map。

    繼承於 Component

--cc.TiledMapAsset

    型別:Class for tiled map asset handling.

    繼承於 Asset

--cc.TiledObjectGroup

    型別:渲染 tmx object group。

--cc.Toggle

    型別:Toggle 是一個 CheckBox,當它和 ToggleGroup 一起使用的時候,可以變成 RadioButton。

    繼承於 Button

--cc.ToggleGroup

    型別:ToggleGroup 不是一個可見的 UI 元件,它可以用來修改一組 Toggle 元件的行為。

    當一組 Toggle 屬於同一個 ToggleGroup 的時候, 任何時候只能有一個 Toggle 處於選中狀態。

    繼承於 Component

--cc.Touch

    型別:封裝了觸控相關的資訊。

--cc.V2F_C4B_T2F

    型別:

    屬性(properties)

    BYTES_PER_ELEMENT

--cc.V2F_C4B_T2F_Triangle

    型別:  返回型別 V2F_C4B_T2F_Triangle

--cc.V3F_C4B_T2F

    型別:BYTES_PER_ELEMENT ( )

--cc.V3F_C4B_T2F_Quad

    型別:

    屬性(properties)

    BYTES_PER_ELEMENT


--cc.ValueType

    型別:所有值型別的基類。

    定義於: utils/api/engine/cocos2d/core/value-types/CCValueType.js:31

--cc.Vec2

    型別:表示 2D 向量和座標

    繼承於 ValueType


--cc.Vertex2F

    型別:

    屬性(properties)

    BYTES_PER_ELEMENT


--cc.Vertex3F

    型別:

    屬性(properties)

    BYTES_PER_ELEMENT

--cc.VideoPlayer

    型別:Video 元件,用於在遊戲中播放視訊

--cc.View

    型別:

        cc.view is the singleton object which represents the game window.

        It's main task include:

            Apply the design resolution policy

            Provide interaction with the window, like resize event on web, retina display support, etc...

            Manage the game view port which can be different with the window

            Manage the content scale and translation

            Since the cc.view is a singleton, you don't need to call any constructor or create functions,

            the standard way to use it is by calling:

            cc.view.methodName();

        方法

        setTargetDensityDPI (

            densityDPI

        )

        Sets view's target-densitydpi for android mobile browser. it can be set to:

           1. cc.macro.DENSITYDPI_DEVICE, value is "device-dpi"

           2.cc.macro.DENSITYDPI_HIGH, value is "high-dpi" (default value)

           3.cc.macro.DENSITYDPI_MEDIUM, value is "medium-dpi" (browser's default value)

           4.cc.macro.DENSITYDPI_LOW, value is "low-dpi"

           5.Custom value, e.g: "480"

--cc.WebGLColor

    型別:

    屬性(properties)

    BYTES_PER_ELEMENT


--cc.WebView

    型別:WebView 元件,用於在遊戲中顯示網頁

--cc.Widget

    型別:Widget 元件,用於設定和適配其相對於父節點的邊距,Widget 通常被用於 UI 介面,也可以用於其他地方。

    Widget 會自動調整當前節點的座標和寬高,不過目前調整後的結果要到下一幀才能在腳本里獲取到。

    繼承於 Component

--cc.audioEngine

    型別:

    cc.audioengine是單例物件。

    主要用來播放音訊,播放的時候會返回一個 audioID,之後都可以通過這個 audioID 來操作這個音訊物件。

    不使用的時候,請使用 cc.audioEngine.uncache(filePath); 進行資源釋放

    注意:

    在 Android 系統瀏覽器上,不同瀏覽器,不同版本的效果不盡相同。

    比如說:大多數瀏覽器都需要使用者物理互動才可以開始播放音效,有一些不支援 WebAudio,

    有一些不支援多音軌播放。總之如果對音樂依賴比較強,請做盡可能多的測試。

--cc.eventManager

    型別:事件管理器,它主要管理事件監聽器註冊和派發系統事件。

            原始設計中,它支援滑鼠,觸控,鍵盤,陀螺儀和自定義事件。

            在 Creator 的設計中,滑鼠,觸控和自定義事件的監聽和派發請參考 http://cocos.com/docs/creator/scripting/events.html。

    示例:

    // Add KEYBOARD EventListener To StatusLabel.

    cc.eventManager.addListener({

        event: cc.EventListener.KEYBOARD,

        onKeyPressed:  function(keyCode, event){

            var label = event.getCurrentTarget();

            label.setString("Key " + keyCode.toString() + " was pressed!");

        },

        onKeyReleased: function(keyCode, event){

            var label = event.getCurrentTarget();

            label.setString("Key " + keyCode.toString() + " was released!");

        }

    }, statusLabel);

    // Create ACCELERATION EventListener To Sprite.

    cc.eventManager.addListener({

        event: cc.EventListener.ACCELERATION,

        callback: function(acc, event){

            //Here processing logic.

        }

    }, sprite);

--cc.inputManager

    型別:This class manages all events of input. include: touch, mouse, accelerometer, keyboard

--cc.loader

    型別:Loader for resource loading process. It's a singleton object.

    繼承於 Pipeline

--cc.pool

    型別:

    廢棄: !#en Please use cc.NodePool instead !#zh 請使用 cc.NodePool 代替

    首先請注意,在 Creator 中我們強烈不建議使用 cc.pool 來管理 cc.Node 節點物件,請使用 cc.NodePool 代替 因為 cc.pool 是面向類來設計的,而 cc.Node 中使用 Component 來進行組合,它的類永遠都一樣,實際卻千差萬別。

    cc.pool 是一個單例物件,用作為物件快取池。

    它可以幫助您提高遊戲效能,適用於優化物件的反覆建立和銷燬

--cc.screen

    型別:The fullscreen API provides an easy way for web content to be presented using the user's entire screen.

    It's invalid on safari, QQbrowser and android browser


--cc.sys

    型別:System variables

--cc.textureCache

    型別:cc.textureCache is a singleton object, it's the global cache for cc.Texture2D

--cc.url


--cc.visibleRect

    型別:cc.visibleRect is a singleton object which defines the actual visible rect of the current view,

     it should represent the same rect as cc.view.getViewportRect()

--js.array

    模組: js

--sp.Skeleton

    模組: sp

    Spine 骨骼動畫


    (Skeleton 具有對骨骼資料的引用並且儲存了骨骼例項的狀態, 它由當前的骨骼動作,slot 顏色,和可見的 slot attachments 組成。

    多個 Skeleton 可以使用相同的骨骼資料,其中包括所有的動畫,面板和 attachments。

--sp.SkeletonData

    型別:Spine 的 骨骼資料。

    繼承於 Asset

    模組: sp




三、常用列舉

cc.BlendFactor

-列舉:混合因子 可參考: http://www.andersriggelsen.dk/glblendfunc.php

cc.Button.Transition