| 27 | using namespace ax; |
| 28 | |
| 29 | bool Bug1159Layer::init() |
| 30 | { |
| 31 | if (BugsTestBase::init()) |
| 32 | { |
| 33 | auto s = Director::getInstance()->getWinSize(); |
| 34 | |
| 35 | auto background = LayerColor::create(Color4B(255, 0, 255, 255)); |
| 36 | addChild(background); |
| 37 | |
| 38 | auto sprite_a = LayerColor::create(Color4B(255, 0, 0, 255), 700, 700); |
| 39 | sprite_a->setAnchorPoint(Vec2(0.5f, 0.5f)); |
| 40 | sprite_a->setIgnoreAnchorPointForPosition(false); |
| 41 | sprite_a->setPosition(0.0f, s.height / 2); |
| 42 | addChild(sprite_a); |
| 43 | |
| 44 | sprite_a->runAction(RepeatForever::create(Sequence::create(MoveTo::create(1.0f, Vec2(1024.0f, 384.0f)), |
| 45 | MoveTo::create(1.0f, Vec2(0.0f, 384.0f)), nullptr))); |
| 46 | |
| 47 | auto sprite_b = LayerColor::create(Color4B(0, 0, 255, 255), 400, 400); |
| 48 | sprite_b->setAnchorPoint(Vec2(0.5f, 0.5f)); |
| 49 | sprite_b->setIgnoreAnchorPointForPosition(false); |
| 50 | sprite_b->setPosition(s.width / 2, s.height / 2); |
| 51 | addChild(sprite_b); |
| 52 | |
| 53 | auto label = MenuItemLabel::create(Label::createWithSystemFont("Flip Me", "Helvetica", 24), |
| 54 | AX_CALLBACK_1(Bug1159Layer::callBack, this)); |
| 55 | auto menu = Menu::create(label, nullptr); |
| 56 | menu->setPosition(s.width - 200.0f, 50.0f); |
| 57 | addChild(menu); |
| 58 | |
| 59 | return true; |
| 60 | } |
| 61 | |
| 62 | return false; |
| 63 | } |
| 64 | |
| 65 | void Bug1159Layer::callBack(Object* sender) |
| 66 | { |
nothing calls this directly
no test coverage detected