These are chat archives for fireyang/cocos2d-x

8th
Mar 2019
dinindu-d
@dinindu-d
Mar 08 04:01
@gavar I'm not recommended to use it to develop a website
dinindu-d
@dinindu-d
Mar 08 10:06
Why this keep getting invalid token error,
pasting formed '->config_v2', an invalid preprocessing token
#define REGISTER_OVERLAY(config) \
this->overlay = ui::Button::create(tex_img_overlay); \
this->overlay->setContentSize(Size(this->##config##.window.width, this->##config##.window.height)); \
this->overlay->setPosition(Vec2((this->##config##.window.width / 2) + this->##config##.origin.x, (this->##config##.window.height / 2) + this->##config##.origin.y)); \
this->overlay->setScale(Director::getInstance()->getContentScaleFactor()); \
this->overlay->runAction(FadeIn::create(this->duration)); \
this->##config##.parent->addChild(this->overlay, this->##config##.zIndexBase); \
this->overlay->addTouchEventListener([&](Ref* sender, ui::Widget::TouchEventType type) { \
    if (!this->dialog) return; \
    const float zoom = 0.05f; \
    const float duration = 0.1f; \
    switch (type) { \
        case ui::Widget::TouchEventType::BEGAN: { \
            auto zoom_in = ScaleTo::create(duration, this->dialog->getScale() + zoom); \
            this->dialog->runAction(zoom_in); \
            break; \
        } \
        case ui::Widget::TouchEventType::ENDED: { \
            auto zoom_out = ScaleTo::create(duration, this->dialog->getScale() - zoom); \
            this->dialog->runAction(zoom_out); \
            break; \
        } \
        default: break; \
    } \
});
pasting formed '->config_v2', an invalid preprocessing token