MCPcopy Create free account
hub / github.com/axmolengine/axmol / alignMenusH

Method alignMenusH

tests/cpp-tests/Source/MenuTest/MenuTest.cpp:247–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245MenuLayer2::~MenuLayer2() {}
246
247void MenuLayer2::alignMenusH()
248{
249 for (int i = 0; i < 2; i++)
250 {
251 auto menu = static_cast<Menu*>(getChildByTag(100 + i));
252 menu->setPosition(_centeredMenu);
253 if (i == 0)
254 {
255 // TIP: if no padding, padding = 5
256 menu->alignItemsHorizontally();
257 auto p = menu->getPosition();
258 menu->setPosition(p + Vec2(0.0f, 30.0f));
259 }
260 else
261 {
262 // TIP: but padding is configurable
263 menu->alignItemsHorizontallyWithPadding(40);
264 auto p = menu->getPosition();
265 menu->setPosition(p - Vec2(0.0f, 30.0f));
266 }
267 }
268}
269
270void MenuLayer2::alignMenusV()
271{

Callers

nothing calls this directly

Calls 6

getChildByTagFunction · 0.85
Vec2Function · 0.50
setPositionMethod · 0.45
getPositionMethod · 0.45

Tested by

no test coverage detected