| 268 | } |
| 269 | |
| 270 | void MenuLayer2::alignMenusV() |
| 271 | { |
| 272 | for (int i = 0; i < 2; i++) |
| 273 | { |
| 274 | auto menu = static_cast<Menu*>(getChildByTag(100 + i)); |
| 275 | menu->setPosition(_centeredMenu); |
| 276 | if (i == 0) |
| 277 | { |
| 278 | // TIP: if no padding, padding = 5 |
| 279 | menu->alignItemsVertically(); |
| 280 | auto p = menu->getPosition(); |
| 281 | menu->setPosition(p + Vec2(100.0f, 0.0f)); |
| 282 | } |
| 283 | else |
| 284 | { |
| 285 | // TIP: but padding is configurable |
| 286 | menu->alignItemsVerticallyWithPadding(40); |
| 287 | auto p = menu->getPosition(); |
| 288 | menu->setPosition(p - Vec2(100.0f, 0.0f)); |
| 289 | } |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | void MenuLayer2::menuCallback(Object* sender) |
| 294 | { |
nothing calls this directly
no test coverage detected