3D shape script interface

The I3DShapeInstance interface derives from IWorldInstance to add APIs specific to the 3D shape plugin.

3D Shape APIs

shape
Set or get a string representing the the current shape being displayed. This must be one of "box", "prism", "wedge", "pyramid", "corner-out" and "corner-in".
zHeight
Set or get the current Z height (i.e. depth) of the 3D shape. Note the Z height must be greater or equal to 0.
setFaceVisible(face, visible)
Set whether a face is visible or invisible based on the boolean visible. The face parameter is a string identifying the face which must be one of "back", "front", "left", "right", "top" and "bottom".
isFaceVisible(face)
Return a boolean indicating whether a given face is visible. The face parameter is a string identifying the face which must be one of "back", "front", "left", "right", "top" and "bottom".
setFaceImage(face, image)
Change one of the shape faces to use one of the other face images. For example this allows swapping the front face image for the back face image. To restore the original image, use the same face for both parameters. Both parameters are strings identifying the face to use, which must be one of "back", "front", "left", "right", "top" and "bottom".
setFaceObject(face, objectClass)
Replace the image used for a face of the shape with the image used by a Sprite, Tiled Background or 9-Patch object. An instance of the given object must exist on the current layout. The face parameter is a string identifying the face which must be one of "back", "front", "left", "right", "top" and "bottom". The objectClass parameter is an IObjectClass referencing the object to set for the given face. Only Sprite, Tiled Background and 9-Patch object types are supported.
zTilingFactor
Set or get the Z tiling factor property of the 3D shape. For more information, refer to the 3D shape plugin manual entry.
getImagePointCount()
Return the number of image points on the back face.
getImagePointX(nameOrIndex)
getImagePointY(nameOrIndex)
getImagePoint(nameOrIndex)
Return the location of an image point on the back face in layout co-ordinates. Image points are identified either by a case-insensitive string of their name, or their index. Note image point 0 is the origin, so index 1 is the first image point. If the image point is not found, this returns the origin instead. The getImagePoint variant returns [x, y].
Construct 3 Manual 2021-06-09

On this page