| 33 | using namespace ax; |
| 34 | |
| 35 | bool Bug458Layer::init() |
| 36 | { |
| 37 | if (BugsTestBase::init()) |
| 38 | { |
| 39 | // ask director the the window size |
| 40 | auto size = Director::getInstance()->getWinSize(); |
| 41 | |
| 42 | auto question = new QuestionContainerSprite(); |
| 43 | auto question2 = new QuestionContainerSprite(); |
| 44 | question->init(); |
| 45 | question2->init(); |
| 46 | |
| 47 | // [question setContentSize:CGSizeMake(50,50)]; |
| 48 | // [question2 setContentSize:CGSizeMake(50,50)]; |
| 49 | |
| 50 | auto sprite = MenuItemSprite::create(question2, question, AX_CALLBACK_1(Bug458Layer::selectAnswer, this)); |
| 51 | auto layer = LayerColor::create(Color4B(0, 0, 255, 255), 100, 100); |
| 52 | question->release(); |
| 53 | question2->release(); |
| 54 | |
| 55 | auto layer2 = LayerColor::create(Color4B(255, 0, 0, 255), 100, 100); |
| 56 | auto sprite2 = MenuItemSprite::create(layer, layer2, AX_CALLBACK_1(Bug458Layer::selectAnswer, this)); |
| 57 | auto menu = Menu::create(sprite, sprite2, nullptr); |
| 58 | menu->alignItemsVerticallyWithPadding(100); |
| 59 | menu->setPosition(size.width / 2, size.height / 2); |
| 60 | |
| 61 | // add the label as a child to this Layer |
| 62 | addChild(menu); |
| 63 | |
| 64 | return true; |
| 65 | } |
| 66 | return false; |
| 67 | } |
| 68 | |
| 69 | void Bug458Layer::selectAnswer(Object* sender) |
| 70 | { |
nothing calls this directly
no test coverage detected