Developed with Cocos2d-x v3.2, by Hans Zhang (ezburg@gmail.com).
btnNext = ScalableSprite::create("next.png",
[this, nextChapter, nextLevel, showNext]() {
m_doneLayer->removeFromParent();
m_doneLayer = nullptr;
m_nChapter = nextChapter;
m_nLevel = nextLevel;
this->loadLevel();
this->scaleBlocks(0);
}
);
typedef std::function<void(Ref *, Touch *, Event *)> touchCallback;
class Block : public Node
{
CC_CONSTRUCTOR_ACCESS:
virtual ~Block() {}
virtual bool init(const Color4B& bgColor,
const string& title,
const touchCallback& onTouchEnd,
const touchCallback& onTouchBegan,
const touchCallback& onTouchMoved,
const touchCallback& onTouchCancelled);
};
And its sub class:
class DraggableBlock : public Block
{
// ...
};
- CrossHelper
- CrossiOS
- CrossAndroid
Run on windows:
Classes/CreateCocos2dxClass.exe