MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / alignItemsVerticallyWithPadding

Method alignItemsVerticallyWithPadding

Source/GameToolbox/nodes.cpp:212–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210}
211
212void GameToolbox::alignItemsVerticallyWithPadding(ax::Vector<ax::Node*> _children, float padding) {
213 float height = -padding;
214
215 for (const auto& child : _children)
216 height += child->getContentSize().height * child->getScaleY() + padding;
217
218 float y = height / 2.0f;
219
220 for (const auto& child : _children) {
221 child->setPosition(0, y - child->getContentSize().height * child->getScaleY() / 2.0f);
222 y -= child->getContentSize().height * child->getScaleY() + padding;
223 }
224}
225
226int GameToolbox::getHighestChildZ(ax::Node* node)
227{

Callers

nothing calls this directly

Calls 1

setPositionMethod · 0.80

Tested by

no test coverage detected