Questions tagged [cocos2d-x]
C++ cross-platform version of Cocos2D, an open-source mobile 2D game framework.
3,903
questions
0
votes
1
answer
33
views
Cocos 2dx 4.x. Enable C++17 in Android Studio
I am trying to learn Cocos 2dx game engine. I generated a simple project with this command:
cocos new -l cpp -p com.testgame1 -d path_to_dir testgame1
Next, I try to build an android project. ...
0
votes
0
answers
30
views
Firebase Log Events query
Hello how i can see firebase log event data without enable the debug mode in firebase event section. if it's necessary to enable the debug mode then how i can on debug mode in my androide studio for ...
1
vote
0
answers
33
views
How can i change the entire speed (timing) of a android game made with cocos2dx?
i'm making reverse engineering on a android game made with cocos2dx library, editing the .so file (libcocos2dcpp.so) with ida pro and a hex editor. i've getting success changing small things, like ...
0
votes
0
answers
35
views
Need to Understands the Multi-Resolution Adaptation in cocos2dx
kindly please help me to understand that what changes and what ResolutionPolicy required for project in Android and ios to Support Multi Resolution without stretch images in cocos2dx c++.
0
votes
0
answers
20
views
Trying to add touch listener to a clipped image
Hi I have tried to cut a square/rectangle image to a circular one using the ClippingNode in cocos2dx but when I try to click on the clipped image and try to get the touch points on it... I didn't get ...
0
votes
0
answers
52
views
Is there a way to skip part of function in IDA?
I'm new to reverse engineering and im trying to edit one function then patch apk. This is an old unsupported apk where i want to enable one function, but it have some fail checks. I think the easiest ...
0
votes
0
answers
80
views
How to add libz and libiconv?
When trying to build cocos2d-x v4 based project, I get the following error:
clang: error: no such file or directory: '/usr/lib/libz.dylib'
clang: error: no such file or directory: '/usr/lib/libiconv....
0
votes
0
answers
33
views
How to persist game data such as score table, player names in Cocos Creator 3.x?
What is the recommended technique to persist simple game data such as score table, player names, user preferences, etc?
Is there a technique working across all platforms native+web?
I've found some ...
0
votes
0
answers
55
views
How to flip a node as part of Tween sequence in Cocos Creator 3.x
In creator2.x I've used cc.orbitCamera to flip one node into another. just like flipping a coin from one side to the other.
What technique should I use in creator3.x where cc.orbitCamera is missing. ...
0
votes
0
answers
9
views
What controls coordinate system origin in 2d rendering scene
If I create new "Empty (2d)" project then a scene with 1 camera is pre-created there.
The camera default position and rotation is more like 3d scene though: position=-10,10,10 rotation=-35,...
0
votes
1
answer
58
views
Adding code to my AppDelegate / AppController
I'm trying to add code to my AppDelegate. But I am not sure where to do it - and how exactly.
I am trying to achieve Deep Linking, so I am trying to add my code, which adds a global variable '
window....
-1
votes
1
answer
44
views
COCOS2D AUDIO ENGINE
I am experiencing some issues playing music in my game through cocos2d and I can't seem to pin point the issue this is my code to run the music
AudioEngine::play2d("Resources/audio/musicStage1....
0
votes
0
answers
32
views
Cocos2dx - remove "DONE" button above soft keyboard in android
I have checked some of the question that how to add "DONE" button above soft keyboard but there is no any questions that how to remove that button. when I click on any EditText in the app ...
0
votes
0
answers
15
views
Use of RenderTexture and round to integer positions
I realized that a sprite which texture is set to “setAliasTexParameters” must be placed on integer positions to avoid pixel bleeting when moved.
That’s fine but if I use a RenderTexture with screen ...
0
votes
0
answers
50
views
Cocos Creator 3.4.1. Shadows
I'm new at this. I'm reading "Quick Start" and ran into a problem. Character shadows are not displayed ( Lights and shadows). I downloaded the example from github, unpacked it, opened it in ...
0
votes
0
answers
100
views
VCRUNTIME140D.dll is not found
I created an .exe with VS2019, and I have the following error when I run it on other computer :
"impossible to run the code because "VCRUNTIME140D.dll" is not found"
I know that ...
0
votes
1
answer
55
views
Cocos2dx. Creating a sequence that contains RepeatForever
I need to create a sequence that runs one action, then repeats tho other actions forever. But creating a sequence with an action and a RepeatForever is impossible. You can see my code below:
auto ...
0
votes
1
answer
38
views
Cocos2dx 3.17.2 Project size over 10 gb After compiling For android
After compiling for Android in Debug and Release APK the compiled files are Taking so much space. is there any way to reduce it?
.ccx is taking 5 gb space and .externalNativeBuild taking 2 gb space
0
votes
0
answers
80
views
Cocos Creator 3.4.1 and SDK 16
I am a beginner in development on Cocos Creator (3.4.1). I have a device with android 4.1 (sdk 16). Is there any way to downgrade the MIN_SDK_VERSION in Creator to test on this device? Either only ...
0
votes
0
answers
33
views
Directory not visible in Visual Studio - Cocos2d-x
I would like to view the classes directory in my cocos2d-x project in Visual Studio.
Here is the project structure. The .sln file is in the proj.win32 folder.
If I open the .sln in Visual Studio it ...
0
votes
0
answers
17
views
Unsatisfied Link Error in Old cocos2dx 2.2.6 Application
I'm attempting to run an old cocos2d-x 2.2.6 application through eclipse and I'm getting the error
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/game/base....
0
votes
0
answers
54
views
How do I make a maze game by adapting my cocos2d-x&C++ code?
I generate a matrix about my game map by random Prim. Then I draw the map by menuItem in the cocos2d-x 4.0. I want to control a sprite to move by key "asdw". But I cannot control the sprite ...
1
vote
0
answers
99
views
Cordova app is running smoothest when I touch screen and don't leave finger
Recently I created a Cordova app for my html5 game created in Cocos Creator engine.
After some time, I noticed the app running on android not as smooth as in browser. I googled a lot of questions but ...
0
votes
0
answers
16
views
cocos2d-x version 4.0 local storage missing component
In cocos2d-x version 3.13, there used to be cocos2d-x/cocos/storage directory which was responsible for creating sqlite database. That database was used extensively for persistence storage of ...
0
votes
0
answers
25
views
cocos2dx-android plist reading crash at rapidxml_sax3.hpp sometimes
Our app on Android crash sometime and the possibility of crash is about 1%.
We check the crash log, and find out that the app crash at rapidxml_sax3.hpp.
void rapidxml::xml_sax3_parser<char>::...
0
votes
0
answers
25
views
The game flashes back while running
1
#00 pc 0001db6a /system/lib/libc.so (abort+57) [armeabi-v7a::da0808997957f776db4fa5c137619bca]
2
#01 pc 0002fb41 /system/lib/libc++.so [armeabi-v7a::6edf565341120165c917a5feb53cb012]
3
java:
4
org....
2
votes
0
answers
121
views
" java.lang.NullPointerException" when trying to run new Cocos-2dX android project
This error is bothering me for days.
As I mentions, I've create a new project but cannot run it (The project builds on Win32 well but Android).
What I have done:
Downloaded all required: Cocos2d-X v3....
1
vote
1
answer
69
views
Trying to get user input to move sprite in Cocos2D-X
I'm trying to make user input of WASD move a sprite around in Cocos2D-X. I'm pretty sure I'm doing everything correct but it gives me this error:
expression must be a modifiable lvalue.
Here is my ...
0
votes
0
answers
33
views
cocos2d-x didnt compile with box2d
i cant include box2d in cocos2d-x.
i compile for android using cmake
add_subdirectory(MyGame/cocos2d/external/Box2D ${PROJECT_BINARY_DIR}/box2d)
add_definitions(-DCC_ENABLE_BOX2D_INTEGRATION=1)
...
0
votes
0
answers
45
views
Accelerometer in Cocos Creator
Someone knows a way to integrate the accelerometer in Cocos Creator (Version 2.3) in a 2D project. I don´t find any information about this. I use Typescript.
Any help?
0
votes
1
answer
1k
views
CMake Error at cocos2d/cmake/Modules/CocosConfigDepend.cmake:94 (endmacro): Flow control statements are not properly nested
Hey I'm a newbie cocos 2d x developer, I'm just trying to get a "Hello World" project created in XCode for iOS. From the terminal I'm using the command
cmake ../.. -GXcode -...
1
vote
1
answer
104
views
Cant Open Lua Scene Spine Test Cocos2dx v4
im using cocos Lua v4. and im looking how to create spine in Lua. But unfortunately, when im open Lua Test in Spine section. Its not showing spine, i got this error
attempt to index global ‘sp’ (a ...
2
votes
0
answers
42
views
Cocos 2dx control playback speed of currently playing audio effect
Hi I am playing a sound effect in a cocos game using this method from SimpleAudioEngine
Is there a way to control the playback rate (speed up or slow down) of this audio at runtime.
int playEffect(...
1
vote
3
answers
861
views
Calling Kotlin from Java (cannot find symbol)
I am trying to call a function in Kotlin from Java.
Documentation says that it is easy. I have follow this post without luck so far.
https://kotlinlang.org/docs/java-to-kotlin-interop.html#package-...
0
votes
0
answers
44
views
Joystick in cocos2dx - version 4
I'm try some joystick from cocos2dx version 3 and 2 It's work so good, but my project need up to cocos2dx version 4, Somepeople can help me some code example for it , Thank a lot of
-2
votes
2
answers
87
views
How to integrate Node.js Server in My cocod2d-x (C++) Game
I am new in Multiplayer Game Development, I have already developed a offline game and now I want to make it a multiplayer, so with help of my friend we create a server side script in node.js, but I ...
0
votes
3
answers
74
views
Cocos2d-x Multithreading sceanrio crashes the game
my scenario is simple:i made a game using cocos2d-x and i want to download images (FB and Google play) for multi player users and show them once the download is done as texture for a button.
in ideal ...
0
votes
1
answer
49
views
Pause Shader that uses CC_TIME in cocos2d-x
I am using a shader that is using cocos2d-x's variable CC_Time[1].
I am wondering how to tell cocos2d-x not to update anymore the CC_Time value, when I want to pause my game.
Thanks for your help!
0
votes
0
answers
147
views
How do I change default python to 2.7 on Mac Catalina?
Python 2.7 is no longer available on Mac Catalina, but I need it to be my default python to get Cocos Creator to build iOS apps correctly. I tried installing Python, and setting the alias as follows, ...
1
vote
1
answer
70
views
Path / Location of Cocos2d-x UserDefault data in IOS?
I am tasked to migrate an IOS game made with Cocos2d-x into Unity. One of the issues I have is that I don't know where Cocos2d-x writes the user's saved data. The Unity version of the app needs to ...
1
vote
1
answer
23
views
cocos2dx with box2d contactlistener doesnt work
im using box2d 2.3.1physics engine in my cocos2dx v4 project. My polygon shapes are created using physics editor. all colliding itself properly but contact listener doesnt log contacts.
this is my ...
0
votes
1
answer
80
views
Cocos2dx: Can't access my own sprite file (.png) in the Resources folder
Using Visual Studio 2019, I am trying to create a sprite in HelloWorld::init() in HelloWorldScene.cpp and therefore need to access "player.png" within the Resources folder. However it throws ...
1
vote
0
answers
42
views
Cocos2d tiled map - AttributeError
Hello I'm developing a game with cocos2d in python. I am trying load a tiled map, but i have problems with it.
1-Large time of loading a tmx file.
2-Atribute error while loading the tiled map.
My code:...
0
votes
1
answer
26
views
Same code in cocos2d-x produces different graphical output. Why does this Happen and how to correct it?
I have a project which I build on Android and Linux in cocos2d-x. In this I have a little rocket-ship which has 2 thrusters with both have its own little flame. I build the Node for it like this:
/...
1
vote
0
answers
67
views
Crash on cocos2d::TextureCache::loadImage()
I am using cocos2dx-v3.17.2, ndk-r21d, android studio 4.1.1 . I am experiencing a crash on
cocos2d::TextureCache::loadImage() + 290
My crash stack trace from firebase crashlytics is like below image:...
1
vote
1
answer
156
views
How to make a grid layout in coco2dx like in the creator?
I want to make a grid layout in a scrollview in a cpp project like in cocos creator. But i have got problems.
I can not find properties of layout in cpp version like this
creator's properties of ...
0
votes
1
answer
175
views
Cocos2d-x Display resolution problem in in iPad Air(4th Gen) and iPadPro 11 inch
I used resource of 2048x1536 for all iPad device. Resolution is not perfect in iPad Air(4th Gen) and iPadPro 11 inch.
In all other iPad display correct.
Tested in Cocos2dx v4.0
Here is my code:
if (...
1
vote
1
answer
538
views
Crash when run apk file with size over 2GB
When I installed APK game local (build by cocos2d-x) (copy over USB) with resources over size 2GB, check log adb has error, google play store has popup keep stopping and i cannot run my apk :
A/libc: ...
0
votes
1
answer
96
views
Why is the rendering of ui::Text components which use UTF-8 strings being limited when I run my cocos2dx game on an android device?
I'm developing a game in C++ on the cocos2dx game engine. I've mostly been testing it on the win32 platform but recently tried it out on android. When I did I found things were not running as expected....
0
votes
1
answer
65
views
apply surface friction in box2d
I start to try clone this game with box2d/cocos2d-x
https://play.google.com/store/apps/details?id=com.miniclip.carrom&hl=en&gl=US
and I have multi problem and need your help.
first: how I can ...