MCPcopy Create free account
hub / github.com/defold/defold / SetLayout

Function SetLayout

engine/gui/src/gui.cpp:1284–1299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1282 }
1283
1284 Result SetLayout(const HScene scene, dmhash_t layout_id, SetNodeCallback set_node_callback)
1285 {
1286 scene->m_LayoutId = layout_id;
1287 uint16_t index = GetLayoutIndex(scene, layout_id);
1288 uint32_t n = scene->m_Nodes.Size();
1289 InternalNode* nodes = scene->m_Nodes.Begin();
1290 for (uint32_t i = 0; i < n; ++i)
1291 {
1292 InternalNode *n = &nodes[i];
1293 if(!n->m_Node.m_NodeDescTable)
1294 continue;
1295 set_node_callback(scene, GetNodeHandle(n), n->m_Node.m_NodeDescTable[index]);
1296 n->m_Node.m_DirtyLocal = 1;
1297 }
1298 return RESULT_OK;
1299 }
1300
1301 HNode GetNodeHandle(InternalNode* node)
1302 {

Callers 4

TEST_FFunction · 0.50
OnWindowResizeCallbackFunction · 0.50
ApplyLayoutFromScriptFunction · 0.50
SetupGuiSceneFunction · 0.50

Calls 4

GetLayoutIndexFunction · 0.70
GetNodeHandleFunction · 0.70
SizeMethod · 0.45
BeginMethod · 0.45

Tested by 1

TEST_FFunction · 0.40