Keeping an object member variable
In constructor: _variable= Node::create(); _variable->retain(); In destructor: CC_SAFE_RELEASE(_variable);
Continue readingEverything should be made as simple as possible, but not simpler – Einstein
In constructor: _variable= Node::create(); _variable->retain(); In destructor: CC_SAFE_RELEASE(_variable);
Continue readingfrom: Cocos2d-x Cookbook by Akihito Matsuura (Packt Publishing, 2015) By extending Director class and adding two methods, previousScene and popScene, we can
Continue readingcocos2d::StringUtils::toString method can generate std::string value from variety of values int i= 100; std::string int_string= cocos2d::StringUtils::toString(i); CCLOG(“%s”, int_string.c_str()); float j= 123.4f;
Continue readingfrom: http://discuss.cocos2d-x.org/t/why-use-cocos2d-vector-instead-of-std-vector/14527 cocos2d::Vector has the limitation that the objects added to it must have cocos2d::Ref as a base class. The benefit
Continue readingfrom: http://discuss.cocos2d-x.org/t/any-differences-between-vec2-and-point-in-cocos2d-x3-2/15612 Point was refactored to Vector2 and then Vec2. However, Because Point was already wide-spread, it was typedef-ed to Point in
Continue readingAdd following script under “Build Phases” as a “New Run Script Phase”. (tested with Xcode 7.2) #!/bin/bash buildNumber=$(/usr/libexec/PlistBuddy -c “Print
Continue readingFrom: https://www.atlassian.com/git/tutorials/migrating-overview prepare Download migration script from Bitbucket: svn-migration-scripts.jar Verify prerequisites: java -jar ~/svn-migration-scripts.jar verify Create and mount case-sensitive disk if necessary
Continue readingfrom “Detailed explanation of Cocos2d-x Multi-resolution adaptation” Cocos2d-iphone used point coordination with suffix like “-hd” to support retina iPhone. But
Continue reading$ git clone –bare my_project my_project.git $ scp -r my_project.git user@git.example.com:/directory/to/git $ git clone user@git.example.com:/directory/to/git/my_project.git
Continue readingQuickselect with std::vector #include <iostream> #include <vector> #include <assert.h> using namespace std; void swap(vector<int>& list, int l, int r) {
Continue reading
Recent Comments