SDK.UI.Util interface provides access to various user interface utilities in the SDK.
Register a callback for handling files drag-and-dropped in to the Construct 3 window. This is part of the Custom Importer API, allowing addons to handle importing files in a custom format. The given callback is invoked when a file is dropped in to the Construct 3 window, providing nothing else has handled it first. The callback must return a promise that resolves with
true if the drop was recognised and imported, otherwise
false if the drop was not recognised as a supported format (in which case Construct will continue running other handlers).
opts parameter of
AddDragDropFileHandler() is an options object, which may specify the following:
callback should have the signature
async function(filename, file, opts). The type of the
file parameter is an IZipFile or Blob depending on the
isZipFormat option. The
opts parameter of the callback will provide the following additional details only when the
toLayoutView option was specified:
layoutView: an ILayoutView interface representing the Layout View that was open when the file was dropped. This also provides access to the associated project, layout, current active layer, and so on.
clientY: the drop position within the window in client co-ordinates.
layoutY: the drop position within the Layout View in layout co-ordinates. This is the position to create any new instances relevant to.
static ShowLongTextPropertyDialog(text, caption)
Show the same dialog used to edit
longtext properties. This is simply a large multi-line text field in a dialog, allowing for long text strings to be more conveniently edited, since the Properties Bar often can only show a small amount of text. Returns a promise that resolves with
null if the dialog was cancelled, else a string of the text in the dialog.