2
我想在jni main.cpp中訪問我的場景,但是當我撥打cocos2d::CCDirector::sharedDirector()->getRunningScene()
時,我無法得到它! 我的代碼:在jni main.cpp中訪問運行場景(cocos2d-x)
void Java_tehrannama_test_tehrannama2_zoomIn(JNIEnv* env, jobject thiz,jfloat s) {
__android_log_print(ANDROID_LOG_DEBUG, "zoom1", "zooom");
HelloWorld* helloworld = dynamic_cast<HelloWorld*>(cocos2d::CCDirector::sharedDirector()->getRunningScene());
helloworld->zoomin(s);
helloworld->center.x = helloworld->center.x -10000;
}
我沒有其他的場景,然後爲HelloWorld。
我可以知道你爲什麼要這樣做? –
我想使用sdk ui並在我的cocos2d-x代碼和java代碼之間進行交互。 – Ocelot