MCPcopy
hub / github.com/4ian/GDevelop / createObjectOnScene

Function createObjectOnScene

GDevelop.js/TestUtils/GDJSMocks.js:724–735  ·  view source on GitHub ↗
(objectsContext, objectsLists, x, y, layer)

Source from the content-addressed store, hash-verified

722};
723
724const createObjectOnScene = (objectsContext, objectsLists, x, y, layer) => {
725 const objectName = objectsLists.firstKey();
726 const obj = objectsContext.createObject(objectName);
727 if (obj !== null) {
728 // Ignore position and layer set up of the object as we're in a minimal mock of GDJS.
729
730 // Let the new object be picked by next actions/conditions.
731 if (objectsLists.containsKey(objectName)) {
732 objectsLists.get(objectName).push(obj);
733 }
734 }
735};
736
737/**
738 * @param {any} objectsContext

Callers

nothing calls this directly

Calls 5

pushMethod · 0.65
getMethod · 0.65
firstKeyMethod · 0.45
createObjectMethod · 0.45
containsKeyMethod · 0.45

Tested by

no test coverage detected