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

Method getOrCreateLayoutComponent

core/ui/UIWidget.cpp:268–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266void Widget::initRenderer() {}
267
268LayoutComponent* Widget::getOrCreateLayoutComponent()
269{
270 auto layoutComponent = this->getComponent(__LAYOUT_COMPONENT_NAME);
271 if (nullptr == layoutComponent)
272 {
273 LayoutComponent* component = LayoutComponent::create();
274 this->addComponent(component);
275 layoutComponent = component;
276 }
277
278 return (LayoutComponent*)layoutComponent;
279}
280
281void Widget::setContentSize(const Vec2& contentSize)
282{

Callers 5

setSizePercentMethod · 0.95
setSizeTypeMethod · 0.95
setPositionPercentMethod · 0.95
setPositionTypeMethod · 0.95
UIWidget.cppFile · 0.80

Calls 3

createFunction · 0.85
addComponentMethod · 0.80
getComponentMethod · 0.45

Tested by

no test coverage detected