| 3271 | } |
| 3272 | |
| 3273 | DrawNodeAxmolTest2::DrawNodeAxmolTest2() |
| 3274 | { |
| 3275 | selectedRadioButton = 0; |
| 3276 | |
| 3277 | _radioButtonGroup = ui::RadioButtonGroup::create(); |
| 3278 | addChild(_radioButtonGroup, 50); |
| 3279 | |
| 3280 | static const float BUTTON_WIDTH = 30; |
| 3281 | static float startPosX = 0; |
| 3282 | |
| 3283 | // Create the radio buttons |
| 3284 | static const int NUMBER_OF_BUTTONS = 2; |
| 3285 | startPosX = size.width / 2.0f - ((NUMBER_OF_BUTTONS - 1) / 2.0f) * BUTTON_WIDTH; |
| 3286 | for (int i = 0; i < NUMBER_OF_BUTTONS; ++i) |
| 3287 | { |
| 3288 | ui::RadioButton* radioButton = |
| 3289 | ui::RadioButton::create("cocosui/radio_button_off.png", "cocosui/radio_button_on.png"); |
| 3290 | float posX = startPosX + BUTTON_WIDTH * i; |
| 3291 | radioButton->setPosition(Vec2(posX, size.height - 80)); |
| 3292 | radioButton->setScale(1.2f); |
| 3293 | radioButton->setTag(i); |
| 3294 | _radioButtonGroup->addRadioButton(radioButton); |
| 3295 | addChild(radioButton, 50); |
| 3296 | radioButton->addEventListener(AX_CALLBACK_2(DrawNodeAxmolTest2::onChangedRadioButtonSelect, this)); |
| 3297 | } |
| 3298 | |
| 3299 | drawNode = DrawNode::create(); |
| 3300 | drawNode->properties.setTransform(true); |
| 3301 | addChild(drawNode, 10); |
| 3302 | |
| 3303 | scheduleUpdate(); |
| 3304 | } |
| 3305 | |
| 3306 | void DrawNodeAxmolTest2::onChangedRadioButtonSelect(ui::RadioButton* radioButton, ui::RadioButton::EventType type) |
| 3307 | { |
nothing calls this directly
no test coverage detected