I have sprite with a Move action, I want to call a function with 3 parameters when sprite finish Move action, I try to use CC_CALLBACK_3and CallFuncN
but i don't know where I put my parameters.
Call function with 3 parameter when sprite finished action
2.4k Views Asked by user3496448 At
1
There are 1 best solutions below
Related Questions in IOS
- URLSession requesting JSON array from server not working
- Incorrect display of LinearGradientBrush in IOS
- Module not found when building flutter app for IOS
- How to share metadata of an audio url file to a WhatsApp conversation with friends
- Occasional crash at NSURLSessionDataTask dataTaskWithRequest:completionHandler:
- Expo Deep linking on iOS is not working (because of Google sign-in?)
- On iOS, the keyboard does not offer a 6-character SMS code
- Hi, there is an error happened when I build my flutter app, after I'm installing firebase packages occurs that error
- The copy/paste functionalities don't work only on iOS in the Flutter app
- Hide LiveActivityIntent Button from Shortcuts App
- While Running Github Actions Pipeline: No Signing Certificate "iOS Development" found: No "iOS Development" signing certificate matching team ID
- Actionable notification api call not working in background
- Accessibility : Full keyboard access with scroll view in swiftui
- There is a problem with the request entity - You are not allowed to create 'iOS' profile with App ID 'XXXX'
- I am getting "binding has not yet been initialized" error when trying to connect firebase with flutter
Related Questions in COCOS2D-X
- i have integrated firebase crashlytics in my ios project it providing me Objc crashes but i want Cpp crash to catch
- Can We Apply AutoPolygon or PolygonSprite to Spine Animations in Cocos2d-x 3.17?
- android studio build failed because of AAPT2
- Setting alpha in Custom Shader not working in cocos2dx
- SocketIO failed to handshake, dont know why
- Android studio error No variants found for 'app' in cocos 2d-x project
- How to make Keyboard button to continuously call callback function when hold-pressed Cocos2d-x
- How to Check for Constant KeyPress in Cocos2d-X? (C++)
- Cocos2dx OpenGl Shader two textures problem
- Cocos2dx Crash - Version 3.17.2
- Android Game Crash On Unity Ads
- Issue with compiling a cocos2d-x 3.17.2 JS/web project
- Using Json.cpp in Cocos2dx v4
- Cocos 2dx 4.x. Enable C++17 in Android Studio
- How can i change the entire speed (timing) of a android game made with cocos2dx?
Related Questions in CCACTION
- How to slow down the All actions of cocos2dx Game
- CCActionSequence/CCActionDelay not delaying each action?
- How to Export a Flash tween or timeline animation as cocos2d-x actions?
- Cocos2d implementation of Pause - The Game scene/layer issue
- Call function with 3 parameter when sprite finished action
- Using a random point in two actions
- Cocos2d CCActionSequence order and delay messed up
- CCActionDelay in End Game Sequence
- CCSprite animation stops when running other action in Cocos2D v3.x iOS
- Cocos2d-x: add parameter in callfuncN_selector
- CCActionSequence for two different objects
- How to add multiple sprites with time interval of 3 seconds and run same CCAction for all in cocos2d
- Cocos2d-x 3.0 Label limit?
- CCActionFollow will not follow the target object and scroll layer
- Cocos2d match target speed to scrolling background
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You shouldn't use CC_CALLBACK_3, use CC_CALLBACK_1 instead:
When you take a look at the create funtion of CallFuncN:
It receives a std::function with only one parameter.
So you should use CC_CALLBACK_1 to rebind the function with 3 or more parameters to a method accept only one parameter and the only one parameter must be Node* and its subtype.
In the CallFuncN example, the cocos2d-x engine would pass the sprite as the first argument to the callfunc1 method. So you only need to care about passing the remaining argument.
BTW, you don't have to use the CallFuncN and the CallFuncN class restrict you to define a method whose first argument must be Node* and its subtype, you could also use CallFunc, here is the code snippet:
This time, we pass the "sprite" as the first argument to the "callfunc2" method.