Skip to content

8823-scholar/cocos2dx-mruby

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cocos2dx-mruby

mruby binding for Cocos2d-x

Working in progress, very limited classes and methods are implemented.

How to use

  • Create cocos2d-x project.
  • Put source files under mruby_binding into libs/ directory in the project.
  • Add header include paths for
    • mruby_binding/include
  • For Xcode, set Target > Build Settings > Search Paths > Always Search User Paths to NO.
  • Use CCMrubyEngine and start mruby script using executeScriptFile()
#include "CCMrubyEngine.h"

  CCMrubyEngine* pEngine = CCMrubyEngine::defaultEngine();
  CCScriptEngineManager::sharedManager()->setScriptEngine(pEngine);
  
  std::string path = CCFileUtils::sharedFileUtils()->fullPathForFilename("hello.rb");
  pEngine->executeScriptFile(path.c_str());

Example

  • Please see hello.rb
  • Add Classes/* and Resources/* to the according paths
  • Run.

About

mruby binding for Cocos2d-x

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published