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

Function createCustomObject

GDJS/tests/tests/CustomRuntimeObject3D.js:7–23  ·  view source on GitHub ↗
(instanceContainer)

Source from the content-addressed store, hash-verified

5 * @param {gdjs.RuntimeInstanceContainer} instanceContainer
6 */
7 const createCustomObject = (instanceContainer) => {
8 // The corresponding event-based object declaration is done by
9 // getPixiRuntimeGameWithAssets.
10 const customObject = new gdjs.CustomRuntimeObject3D(instanceContainer, {
11 name: 'MyCustomObject',
12 type: 'MyExtension::MyEventsBasedObject',
13 variant: '',
14 isInnerAreaFollowingParentSize: false,
15 variables: [],
16 behaviors: [],
17 effects: [],
18 // Custom objects don't use these dimensions.
19 content: { width: 0, height: 0, depth: 0 },
20 });
21 instanceContainer.addObject(customObject);
22 return customObject;
23 };
24
25 const createSceneWithLayer = (runtimeGame) => {
26 const runtimeScene = new gdjs.RuntimeScene(runtimeGame);

Callers 1

makeCustomObject3DFunction · 0.70

Calls 1

addObjectMethod · 0.45

Tested by

no test coverage detected