Cross Platform Cocos2d-x Lite Version Framework?

Cross Platform Cocos2d-x Lite Version Framework?
0

Hi,
I am using cocos2d-x-v3.17.1 framework to create 2d cross platform games in JS, Just wanted to now is their any Lite version available that supports cross platform games, because most of the modules like 3d, Physics3d, Chipmunk, navmesh etc … am not using in my game…

Attaching a screenshot of apk-src-directory for reference.

Thanks for any response in advance.

Take a look at cocos/base/ccConfig.h, which has pre-processor defines to enable and disable certain functionality.

1 Like

Sorry for delayed response, & thanks for your replay @R101

Tried disabling MACROS still the same result

for example i did something like below, is it correct

/** Use 3d physics integration API. /
#ifndef CC_USE_3D_PHYSICS
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX /
|| CC_TARGET_PLATFORM == CC_PLATFORM_WINRT*/)
#define CC_USE_3D_PHYSICS 0
#endif
#endif

Once you do that, you’ll need to go into the /cocos/CMakeLists.txt, and comment out the relevant parts to see if it will still compile, like this:

set(COCOS_HEADER cocos2d.h
    ${COCOS_2D_HEADER}
    ${COCOS_3D_HEADER}
    ${COCOS_PLATFORM_HEADER}
    ${COCOS_PHYSICS_HEADER}
    #${COCOS_PHYSICS3D_HEADER}
    ${COCOS_MATH_HEADER}
    ${COCOS_NAVMESH_HEADER}
    ${COCOS_RENDERER_HEADER}
    ${COCOS_VR_HEADER}
    ${COCOS_BASE_HEADER}
    ${COCOS_AUDIO_HEADER}
    ${COCOS_UI_HEADER}
    ${COCOS_DEPRECATED_HEADER}
    ${COCOS_NETWORK_HEADER}
    ${COCOS_EDITOR_SUPPORT_HEADER}
    ${COCOS_EXTENSIONS_HEADER}
    ${COCOS_STORAGE_HEADER}
    )

set(COCOS_SRC cocos2d.cpp
    ${COCOS_2D_SRC}
    ${COCOS_3D_SRC}
    ${COCOS_PLATFORM_SRC}
    ${COCOS_PHYSICS_SRC}
    #${COCOS_PHYSICS3D_SRC}
    ${COCOS_MATH_SRC}
    ${COCOS_NAVMESH_SRC}
    ${COCOS_RENDERER_SRC}
    ${COCOS_VR_SRC}
    ${COCOS_BASE_SRC}
    ${COCOS_AUDIO_SRC}
    ${COCOS_UI_SRC}
    ${COCOS_DEPRECATED_SRC}
    ${COCOS_NETWORK_SRC}
    ${COCOS_EDITOR_SUPPORT_SRC}
    ${COCOS_EXTENSIONS_SRC}
    ${COCOS_STORAGE_SRC}
    )

Some of the modules may have dependencies on others that you may want to disable, so you’ll have to sort that out if and when the errors appear.

Okay got it, will try this out @R101 thanks.