Giter VIP home page Giter VIP logo

cocos2d-x-extensions's Introduction

cocos2d-x-extensions

Features

  • CCCrypto: AES256, Base64, MD5, SHA1
  • CCOpenFeint: OpenFeint integration
  • CCNative: show activity indicator, show alert dialog, get OpenUDID, open url
  • CCNetwork: async http request(GET/POST), check network status
  • CCStore: iOS IAP support, with receipt verify
  • 100% Lua-binding compatibility

Example - iOS (without Lua)

  1. Download cocos2d-x 1.x sources from https://github.com/cocos2d/cocos2d-x/tree/master
  2. Copy cocos2dx to examples/cocos2dx-extensions-demo/libs
  3. Open examples/cocos2dx-extensions-demo.xcodeproj
  4. Change examples/cocos2dx-extensions-demo/Classes/CCStoreScene.cpp, SET YOUR IAP PRODUCTS ID
  5. !!! CHANGE Bundle identifier FOR IAP !!!
  6. Run!

Example - iOS (Lua)

Coming soon.

iOS Setup

  1. Add frameworks:

    • MobileCoreService.framework
    • Security.framework
    • StoreKit.framework
    • SystemConfiguration.framework
    • CFNetwork.framework
  2. Copy files (required modules) to your project folder, add files to Xcode project

Luabinding:

  1. Copy luabinding files (required modules), add to Xcode

  2. Add code to AppDelegate.cpp:

    #include "cocos2dx_extension_crypto.h"          // CCCrypto
    #include "cocos2dx_extension_native.h"          // CCNative
    #include "cocos2dx_extension_network.h"         // CCNetwork
    #include "cocos2dx_extension_store.h"           // CCStore
    #include "cocos2dx_extension_openfeint.h"       // CCOpenFeint
    #include "cocos2dx_extension_gamecenter.h"      // CCGameCenter
    
    lua_State* L = CCScriptEngineManager::sharedManager()->getScriptEngine()->getLuaState();
    tolua_cocos2dx_extension_crypto_open(L);        // CCCrypto
    tolua_cocos2dx_extension_native_open(L);        // CCNative
    tolua_cocos2dx_extension_network_open(L);       // CCNetwork
    tolua_cocos2dx_extension_store_open(L);         // CCStore
    tolua_cocos2dx_extension_openfeint_open(L);     // CCOpenFeint
    tolua_cocos2dx_extension_gamecenter_open(L);    // CCGameCenter
    
  3. See https://github.com/dualface/cocos2d-x-lua-framework (Game Framework based cocos2d-x + lua-binding) for how to use.

CCOpenFeint Setup

  1. Add OpenFeint to your project
  2. Copy gamenetwork/openfeint to your project folder, add files to Xcode project
  3. Check CCOpenFeint.h interface

cocos2d-x-extensions's People

Contributors

dualface avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.