mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00

- Custom objects like the 3D particle emitter can be used as any other 3D object - with the same set of actions and conditions thanks to the 3D capability - in the scene editor, their Z position and 3D rotations can be changed - Fix child creation in `doStepPostEvent` function
36 lines
942 B
TypeScript
36 lines
942 B
TypeScript
namespace gdjs {
|
|
/**
|
|
* Base class for 2D custom objects.
|
|
*/
|
|
export class CustomRuntimeObject2D extends gdjs.CustomRuntimeObject {
|
|
constructor(
|
|
parent: gdjs.RuntimeInstanceContainer,
|
|
objectData: ObjectData & CustomObjectConfiguration
|
|
) {
|
|
super(parent, objectData);
|
|
this.getRenderer().reinitialize(this, parent);
|
|
}
|
|
|
|
protected _createRender(): gdjs.CustomRuntimeObject2DRenderer {
|
|
const parent = this._runtimeScene;
|
|
return new gdjs.CustomRuntimeObject2DRenderer(
|
|
this,
|
|
this._instanceContainer,
|
|
parent
|
|
);
|
|
}
|
|
|
|
protected _reinitializeRenderer(): void {
|
|
this.getRenderer().reinitialize(this, this.getParent());
|
|
}
|
|
|
|
getRenderer(): gdjs.CustomRuntimeObject2DRenderer {
|
|
return super.getRenderer() as gdjs.CustomRuntimeObject2DRenderer;
|
|
}
|
|
|
|
getRendererObject() {
|
|
return this.getRenderer().getRendererObject();
|
|
}
|
|
}
|
|
}
|