IObjectType interface represents an object type in Construct. It derives from IObjectClass.
- Return an IAnimationFrame representing the object type's image. The plugin must have specified
SetHasImage(true) in IPluginInfo.
- Open the Animations Editor in Construct to edit the object's image. The plugin must have specified
- Return an array of IAnimation representing the animations in the object type. Note this is only applicable to animated plugin types, e.g. Sprite.
- AddAnimation(animName, frameBlob, frameWidth, frameHeight)
- Add a new animation to the object type. The object type's plugin must be animated (e.g. the Sprite plugin). Animations must have at least one frame, so this method also adds an animation frame. The frameBlob, frameWidth and frameHeight parameters are all optional: if they are omitted, Construct will add a default empty animation frame. If they are provided they are interpreted the same way as IAnimation.AddFrame(); see the linked documentation for more details. The call returns a promise that resolves with the newly created IAnimation.
- Return an array of all IObjectInstances or IWorldInstances of this object type in the project.
- Create a new instance from this object type, and add it to the given ILayer. Returns a new IWorldInstance interface representing the new instance. Note this method is only applicable to
"world" type plugins.
- Return a boolean indicating if the object type belongs to a container.
- Return the IContainer the object type belongs to if any, else
- Create a new container using an array of IObjectType for the members of the container. The array must include the IObjectType this call is made on, must contain at least two elements, and the object type must not already be in a container. Returns an IContainer representing the created container.
Addon SDK Manual
You are here:
Search this manual:
This manual entry was last updated on 16 Nov, 2020 at 16:59