cc.loader.loadRes('gamedata.json', function(err, jsonAsset) {
GlobalData.gameData = jsonAsset.json;
});
android back key support is added in v2.0.1
cc.loader.loadRes('gamedata.json', function(err, jsonAsset) {
GlobalData.gameData = jsonAsset.json;
});
android back key support is added in v2.0.1
Are you sure about that?
Can you register a event using node.on(āEvent nameā, function, node-Target) then trying dispatcher some event using emit with same Event name registered before. Itāll will call Script of node have destroyed. Check scriptās uid, you can see.
I think intended behaviour should be like this, please correct me if Iām wrong. The checkbox actually enables/disables component?
@pandamicro sorry i canāt go into detail but suffice it to say we cache assets and would need to if/else on a per game basis
on another note, can you tell me what happened to _ccsg
class in 2.0? is it possible to access _ccsg.GraphicsNode()
another way in 2.0?
@pandamicro when can we expect v2.0.1? Any estimated release date?
Coz I am thinking about upgrading to 2.x but 2.0 seems to be with too many bugs.
Hi,
I would like to ask if there were some changes made to CocosCreator v2.0, regarding cocos2d::Director::getInstance()
.
I notice that upon comparing between CocosCreator 1.x and CocosCreator 2.x, some changes are as follows:
Director::getInstance()
was changed to Application::getInstance()
cocos2d::Director::getInstance()
were removed/commented.If the above case is true, what would be the best way to migrate function calls that depend on cocos2d::Director::getInstance()
to Application::getInstance()
I tried to include the following header file
#include "base/CCScheduler.h"
#include "base/CCThreadPool.h"
#include "platform/CCApplication.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
#include "platform/android/jni/JniImp.h"
#endif
but it seems that the compiler still marks āApplicationā has not been declared.
This is in line with the problem I encountered with SDKBox
https://184.169.198.12/t/unable-to-compile-cocoscreator-2-project-android-with-sdkbox-admob/43417
Thanks in advance.
Hi,
I would like to thank @yinjimmy for fixing the problem in SDKBox with regards to the cocos2d::Director::getInstance()
problem.
From the fix provided, it seems that the reason why I encountered some problems was I forgot to put the namespace of cococs2d
when I tried calling Application::getInstance()
So the correct fix for CocosCreator 2.x would be:
From cocos2d::Director::getInstance()
it will become cocos2d::Application::getInstance()
Make sure to include #include "platform/CCApplication.h"
Although Iām not 100% sure if you need to include #include "base/CCScheduler.h"
as well.
hi,
I am using creator v2.1.0 and coding in javascript.
I want to execute some target(platform) specific code but donāt know how to do it. I couldnāt find anything online, and saw your post with the following c++(???) code :
#include ābase/CCScheduler.hā
#include ābase/CCThreadPool.hā
#include āplatform/CCApplication.hā#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
#include āplatform/android/jni/JniImp.hā
#endif
now, the above technique doesnāt work in js, and I was wondering how to go about writing code for android in js.
I also tried :
if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) {
myCode;
}
thanks in advance.