Quantcast
Viewing all 2747 articles
Browse latest View live

Android performance issue

@zhangxm wrote:

Hi all,

I found many developers reported Android performance issue on Android, such as this ticket. But many tickets are outdated or did not provide a method to reproduce it. So i created an issue here to collect needed informations and try to fix it.

You are appreciated if you can add a comment there with needed information:

  • cocos2d-x version
  • the Android device information
    • Android OS version
    • device type
  • how to reproduce the performance issue

Thanks.

Posts: 5

Participants: 2

Read full topic


How to get the image from drawable folder android in cc.Sprite?

Gen-libs error C4996

@anhtuan89 wrote:

Hi guys, i have just get source code from gihub, and try to build with win32 with command : cocos gen-libs -p win32. and i got error "...\tools\simulator\framworks\runtime-src\proj.win32\simulator.sln" (1) .....
....cocos\2d/CCSprite.h<474>: error C4996: 'cocos2d::Node::ignoreAnchorPointForPosition': was declared deprecated...".
C4996 is just warning, i dont know why it's error here?
Can someone help me?

Posts: 2

Participants: 2

Read full topic

The project "libbox2d" cannot be started directly

@kasweshi wrote:

Am using windows 10 and I have just created a new project ive tried compiling it on android and the hello world scene is okay. When compiling for windows 10 universal I get the error : The project 'libbox2d' cannot be started directly. I am using cocos2d-x 3.11 I havnt even began creating the game was only testing out the hello world project

Posts: 2

Participants: 2

Read full topic

Android Studio 2.2

@energyy wrote:

Google 2016 IO announced - It will support CMAKE, NDK Build with debug , sounds interesting!

Posts: 2

Participants: 2

Read full topic

Firebase + Cocos2d-x 3.11

@energyy wrote:

After google I/O event wanted to try Firebase Analytics and other stuff, but confused after seeing requirement as it requires Google Play Services v9.0+ , right now SDKBOX using 8.2 version.

I think there will be issues with SDKBOX in this case and maybe v9 not stable right now, is someone having experience with this?

@nite

Is SDKBOX works correctly with GPS v9.0+ ?

Posts: 2

Participants: 1

Read full topic

Lines/pipes and extending Cocos Creator functionality

@ivancuefue wrote:

Hi all,
I'm looking for adopt Cocos2d for our projects. As much as I read, I like it more, but there are some requirements that I don't know how to solve. Because I'm complytely new with Cocos, I'm looking for some help that I can use as starting point.

  • We have to draw lines/pipes in the scenes, they have to be animated usually only in using colors. Parameters as width and corner types (square, rounded or chamfer) would be also appreciated. Can I persist them in the scene format? Do I have to create my own format?
  • To produce these lines/pipes, it's possible to create an extension (or plugin) for Cocos Creator to add line drawing tools? How?
  • It's possible to create a scene exporter for Cocos Creator? I want to traverse the scene graph and create a xml document based on it.

Thanks in advance,
Iván.

Posts: 1

Participants: 1

Read full topic

How to access documentation? Web Links broken


Your recommendations for using Cocos2d-x or Cocos2d-xna or Unity3d?

@Waffle_Dragon wrote:

Hi, I'm new to the forum.

I would like to hear your recommendations on which framework/engine I should use for a mobile game.
I know C++ and C# but I'm still a beginner in both. I'm considering 3 frameworks/engines to make my game with.

I want to publish to both android and ios, but I don't want to rewrite my game for each platform. I also don't want to spend a lot of time on the engine, and to spend more time on the higher level game functions. I would prefer 3d, simply because I can make 3d art but cant do 2d art at all. However I could make 3d models, render them as images, and import them as sprites in my game. So I'm not against 2d. So with that in mind, here is what I have gathered about each framework or engine.

Cocos2d-x is C++, but is only 2d, and I'm unsure if I can publish to ios without rewriting my game in ObjC.

Cocos2d-xna is C#, can do 2d and 3d, and can publish to android and ios. Both Cocos2d-x and xna give me more control, but will require me to do more low level engine work.

Unity3d is C#, can do 2d and 3d, can publish to android and ios, and allows me to focus on just the higher level game functions and not have to worry about engine stuff. But it also cost ~$700 (for students), im also assuming this is a one time fee?

None of these options have royalties to worry about. Cocos is open source but I don't think I will be taking advantage of that for this project.

I might also have some of this information wrong. So I'm asking for your advice/recommendations.
Thanks in advance.

Posts: 8

Participants: 6

Read full topic

Animation reset color and opacity of Sprite

@noprops wrote:

If I change color of the sprite and run Animate, color would be back to default.
It seems color has returned to white in every setSpriteFrame.
For this reason, if I run Tint action and Animate action simultaneously, the sprite would blink.
I want the sprite to keep the color in animation, how would can it be?
I'm using cocos2dx v.3.10.
Thank you.

https://github.com/noprops/SpriteTest

Posts: 2

Participants: 2

Read full topic

Does anyone have cocos2d-x 3.3 spidermonkey folder?

@axel11 wrote:

Hi,

I am trying to compile an old cocos2d-x project (v3.3) for android and I do not have the files in the folder external/spidermonkey. Does anyone still have them (for cocos2d-x-3.3 from December 2014) and may upload them for me? Would be very very helpful Image may be NSFW.
Clik here to view.
smile

Thank you very much!

Best regards,
Axel

Posts: 2

Participants: 2

Read full topic

How to change volume with Simple Audio Engine

@komyg wrote:

Hi,

I am developing a game for iOS and Android using Cocos2d-X 3.10 and I am having trouble chaning the effects volume using the Simple Audio Engine.

I've seen the documentation and the function that I am calling is: audioEngine->setEffectsVolume(volume);., however when I do this, nothing happens (note: I am testing my program on Windows using Visual Studio).

What is stranger is that when I went into the setEffectsVolume function, I found out that it has no implementation. From SimpleAudioEngine.cpp:

//////////////////////////////////////////////////////////////////////////
// volume interface
//////////////////////////////////////////////////////////////////////////

float SimpleAudioEngine::getBackgroundMusicVolume()
{
    return 1.0;
}

void SimpleAudioEngine::setBackgroundMusicVolume(float volume)
{
}

float SimpleAudioEngine::getEffectsVolume()
{
    return 1.0;
}

void SimpleAudioEngine::setEffectsVolume(float volume)
{
}

Does this means that I can't change my volume in Cocos2d-X? Would I have to implement these functions myself?

Posts: 2

Participants: 2

Read full topic

Compile Error [Build_Native.py] - NDK r9d - Please Help!

@itzo wrote:

I am getting the following error when compiling build_native.py for an Android Project using cocos2dx 3.2.
The NDK I use is r9d, but I also tested with r10e. Both are getting the same error. Before compiling, I do the following clean-up: ./build_native.py -n clean but still, this is the error:

5 errors generated.
make: *** [obj/local/armeabi/objs-debug/cocos2dcpp_shared/__/__/Classes/AppDelegate.o] Error 1
make: Leaving directory `/Users/itzo/Documents/Android_Apps/DiamondSlots/DiamondSlot1.2/TEST/proj.android'
Traceback (most recent call last):
  File "./build_native.py", line 159, in <module>
    build(opts.ndk_build_param,opts.android_platform,opts.build_mode)
  File "./build_native.py", line 146, in build
    do_build(cocos_root, ndk_root, app_android_root,ndk_build_param,sdk_root,android_platform,build_mode)
  File "./build_native.py", line 82, in do_build
    raise Exception("Build dynamic library for project [ " + app_android_root + " ] fails!")
Exception: Build dynamic library for project [ /Users/itzo/Documents/Android_Apps/DiamondSlots/DiamondSlot1.2/TEST/proj.android ] fails!

or, running cocos run android-build.py at build folder of cocos2d, I get this:

At global scope:
cc1plus: warning: unrecognized command line option "-Wno-extern-c-compat" [enabled by default]
make: *** [obj/local/armeabi/objs-debug/cocos2dcpp_shared/__/__/Classes/AppDelegate.o] Error 1
make: *** Waiting for unfinished jobs....
make: Leaving directory `/Users/itzo/Documents/Android_Apps/DiamondSlots/DiamondSlot1.2/proj.android'
Error running command, return code: 2.

Android.mk contents, inside jni folder:

LOCAL_PATH := $(call my-dir)
CLASSES_PATH := $(LOCAL_PATH)/../../Classes

include $(CLEAR_VARS)

$(call import-add-path,$(LOCAL_PATH)/../../cocos2d)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/external)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/cocos)

LOCAL_MODULE := cocos2dcpp_shared

LOCAL_MODULE_FILENAME := libcocos2dcpp

LOCAL_SRC_FILES := hellocpp/main.cpp \
                  ../../Classes/AppDelegate.cpp \
                   ../../Classes/PlayGame.cpp \
../../Classes/GameMechanics.cpp \
../../Classes/HelpMe.cpp \
../../Classes/Info.cpp \
../../Classes/MoreChips.cpp \
../../Classes/MoreGames.cpp \
../../Classes/Payouts.cpp \
../../Classes/HelperClasses/AdsController.cpp \
../../Classes/HelperClasses/JNIBridge.cpp \
../../Classes/HelperClasses/Music.cpp \
../../Classes/InAPPManager/InAppController.cpp \
../../Classes/InAPPManager/InAppCallBackHandler.cpp \

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../cocos2d/external/gpg/include/android

LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_gpg_static

# LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static
# LOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_static
# LOCAL_WHOLE_STATIC_LIBRARIES += spine_static
# LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static
# LOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static
# LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static


include $(BUILD_SHARED_LIBRARY)

$(call import-module,.)
$(call import-module,audio/android)
$(call import-module,extensions)

# $(call import-module,Box2D)
# $(call import-module,editor-support/cocosbuilder)
# $(call import-module,editor-support/spine)
# $(call import-module,editor-support/cocostudio)
# $(call import-module,network)
# $(call import-module,extensions)

Here's my BASH_PROFILE:

# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH

# Add environment variable COCOS_CONSOLE_ROOT for cocos2d-x
export COCOS_CONSOLE_ROOT=/Users/itzo/Documents/cocos2d-x-3.2/tools/cocos2d-console/bin
export PATH=$COCOS_CONSOLE_ROOT:$PATH

# Add environment variable COCOS_TEMPLATES_ROOT for cocos2d-x
export COCOS_TEMPLATES_ROOT=/Users/itzo/Documents/cocos2d-x-3.2/templates
export PATH=$COCOS_TEMPLATES_ROOT:$PATH

# Add environment variable NDK_ROOT for cocos2d-x
export NDK_ROOT=/users/itzo/documents/android-ndk-r9d/
export PATH=$NDK_ROOT:$PATH
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

export NDK_MODULE_PATH=/users/itzo/documents/android-ndk-r9d/
export PATH=$NDK_MODULE_PATH:$PATH


# Add environment variable ANDROID_SDK_ROOT for cocos2d-x
export ANDROID_SDK_ROOT=/users/itzo/android-sdks/
export PATH=$ANDROID_SDK_ROOT:$PATH
export PATH=$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH

# Add environment variable ANT_ROOT for cocos2d-x
export ANT_ROOT=/users/itzo/documents/apache-ant-1.9.6/bin
export PATH=$ANT_ROOT:$PATH

# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH

# Add environment variable COCOS_X_ROOT for cocos2d-x
export COCOS_X_ROOT=/Users/itzo/Documents/cocos2d-x-3.2/
export PATH=$COCOS_X_ROOT:$PATH

My aim is to build that successfully and update the libcurl library to address OpenSSL issue!
Thanks, looking forward for your response!

Posts: 1

Participants: 1

Read full topic

Disable scaling for Sprite when it initialised with texture2d

@Igor wrote:

I created texture with size 80x80 pixels. Than initialised Sprite with that texture. But when I add sprite as child to scene, I have 55px Sprite size ( the content scale factor is 1.5 ).

How can I disable scaling for Sprite?

Posts: 1

Participants: 1

Read full topic

Send c++ exception log to server

@VijayK wrote:

I want to send exception log to server as soon as app crash due to any exception, but I am not sure if it is possible or not if it is possible where to do so ?

Posts: 1

Participants: 1

Read full topic


How to compile cocos library itself?

@StanLeung wrote:

Hello everyone,

I have do some change in coding of cocos 3.10 library. But the change isn't reflected in my visual studio project (e.g. I added a function for checking language Chinese (Trad/Simp), but VS said the function has not defined yet), seems I need to find a way to compile the change to 3.10 library, right? Does anyone know about this?

Posts: 1

Participants: 1

Read full topic

How to change the image of sprite which is created from cocos studio?

@satyaKT wrote:

I have loaded a sprite from cocos studio,later i want to change its image and i tried different ways found in the internet but i am not able to change the image
here is my code
1st way

 auto rootNode = CSLoader::createNode("QuizScene1.csb");
 option1 = rootNode->getChildByName<cocos2d::Sprite*>("option1");
option1->setTexture("option1_2.png");
this->addChild(rootNode);

2nd way

auto rootNode = CSLoader::createNode("QuizScene1.csb");
option1 = rootNode->getChildByName<cocos2d::Sprite*>("option1");
option1->setTexture(CCTextureCache::sharedTextureCache()->addImage("option1_2.png"));
this->addChild(rootNode);

Thanks

Posts: 1

Participants: 1

Read full topic

A bit tired of setting up cocos-2d Android

@cubby208 wrote:

Ok, I am pretty frustrated.

I am trying to get a port from Sprite-kit, to Android going before next Saturday, but I cant even get cocos2d going!

I have tried twice now with two different tutorials and almost always get stuck at some error that on forum posts everywhere has yet to have a resolution that fixes it for me. Generally this is because the new ndk has a linking issue, or google now shoves android studio in your face and hides the sdk and tools. Basically all of these tutorials seem to only work if you have the magical versions of everything that existed at the time of creation... now (idk it could just be me) but things just dont seem to be working!

Anyway I was hoping for a suggestion of what tutorial I can try next. Preferably the tutorial would come with all of the SDK, NDK, etc. files that were used in the tutorial so that I dont have to use updated ones. I would prefer a print one, but it has to be thorough.

Any ideas?

I have given up on the last attempt because eclipse started to go really wacky which compouneded the other issues, however if try 3 doesn't go well I will be asking for help if that is ok.

P.S this is the tutorial I used this last time it is from 2015 which is pretty recent, however a lot of things have changed versions and placements.

Posts: 8

Participants: 4

Read full topic

Cocos creator as a way to get around setup

@cubby208 wrote:

I am having a lot of issues setting up cocos android inside of my ide's. I am not a fan of editors at all, but I was wondering could "Cocos Creator" be used to circumvent the setup process? Could I potentially make an entire game in it only touching the editor rarely?

Posts: 1

Participants: 1

Read full topic

Blank screen appears after compiling for windows

Viewing all 2747 articles
Browse latest View live