cocos2d-x
Cocos2dx – 使用 Parse 中 Rest 的方式
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
範例的 Project :
Github 連結 : https://github.com/lenny0929/parseRest_WithCocos2dX/
[閱讀全文…]
Cocos2dx – 在 Xcode中使用 Unit test 設置
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
想要在Cocos2dX 專案中使用 Xcode 內建的 Unit test Framework 需要額外做一些設置。
[閱讀全文…]
Cocos2dx – Setter 以及 Getter 的用法
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
Setter 以及 Getter 是在將類別封裝時常使用的方式, 但針對每個變數實作Setter & Getter既繁瑣又麻煩, 所幸Cocos2dX 有實做出一組 Macro 可供開發者使用。
[閱讀全文…]
Cocos2dx – 多國語言的處理方式
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
多國語言在手機上的支援, 一向是App是否被推薦關鍵指標之一, 一般來說, 最少需要支援最常用的八國語言。
[閱讀全文…]
Cocos2dx – Singleton Class 範例
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
當系統中某項資源只有一個,而且絕對獨一無二時,最適合使用這個Pattern,也就是說使用這個Pattern可以確保物件個體只有一個,不會因programmer的疏忽而產生兩個或兩個以上。
[閱讀全文…]
Cocos2dx – 傳入 Lambda 當作函式參數
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
自從 C++ 11 全面在 Cocos2dx 中使用後, 使得原本的Cocos2dx 更為強大, 其中筆者覺得造成改變最大的因素, 就有 Lambda 語法。
[閱讀全文…]
Cocos2dx – Popup 實作小技巧
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
![](https://lennychen.com/wp-content/uploads/2018/02/cocos2dx_landscape-1.png)
Popup 基本上就是在Scene 的最上層, 跳出一層對話框, 或者是轉圈圈的Loading小圖示等, Cocos2dx 有支援手機原生的對話框 – MessageBox。
[閱讀全文…]