new DesktopUI(options)
Creates an UI instance
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
|
Extends
Classes
Namespaces
Members
-
identifierString
-
A unique string that represents this UI
Methods
-
deserialize(data){Promise}
ui/desktop-ui/core/ui.jsx, line 216 -
Deserializes the given data
Name Type Description data
Object Returns:
Type Description Promise -
dispose()
ui/desktop-ui/core/ui.jsx, line 544 -
Disposes the UI
-
export(download){Promise}
ui/desktop-ui/core/ui.jsx, line 190 -
Exports an image
Name Type Description download
Boolean = false
Returns:
Type Description Promise -
getAssetPath(asset, uiAsset, disableRetina){String}
ui/desktop-ui/core/ui.jsx, line 488 -
Returns the resolved asset path for the given asset name
Name Type Default Description asset
String uiAsset
Boolean false = false
disableRetina
Boolean false = false
Returns:
Type Description String -
getEditor(){PhotoEditorSDK.UI.DesktopUI.Editor}
ui/desktop-ui/core/ui.jsx, line 224 -
Returns the editor
Returns:
Type Description PhotoEditorSDK.UI.DesktopUI.Editor -
getFontLoader(){PhotoEditorSDK.UI.DesktopUI.FontLoader}
ui/desktop-ui/core/ui.jsx, line 529 -
Returns the font loader
Returns:
Type Description PhotoEditorSDK.UI.DesktopUI.FontLoader -
getPreloader(){PhotoEditorSDK.Preloader}
ui/desktop-ui/core/ui.jsx, line 537 -
Returns the preloader
Returns:
Type Description PhotoEditorSDK.Preloader -
getTheme(){Object}
ui/desktop-ui/core/ui.jsx, line 521 -
Returns the theme
Returns:
Type Description Object -
isReady(){Boolean}
ui/desktop-ui/core/ui.jsx, line 234 -
Returns true if the editor is ready for doing operations, e.g., serializing, deserializing and exporting.
Returns:
Type Description Boolean -
onReady(cb)
ui/desktop-ui/core/ui.jsx, line 244 -
Calls a callback when the editor is ready, or immeditially if it's already in a ready state.
Name Type Description cb
function -
run()
ui/desktop-ui/core/ui.jsx, line 151 -
Main entry point for the UI
-
save(download){Promise}
ui/desktop-ui/core/ui.jsx, line 199 -
Exports an image
Name Type Description download
Boolean = false
Returns:
Type Description Promise -
serialize(){Promise}
ui/desktop-ui/core/ui.jsx, line 207 -
Serializes the editor state
Returns:
Type Description Promise -
setImage(image)
ui/desktop-ui/core/ui.jsx, line 476 -
Sets the image to the given one
Name Type Description image
Image -
translate(key, interpolationOptions){String}
ui/desktop-ui/core/ui.jsx, line 468 -
Returns the translation for
key
Name Type Description key
String interpolationOptions
Object optional Returns:
Type Description String
Type Definitions
-
EventsObject
-
Events used by the UI
Properties:
Name Type Description EXPORT
String Emitted when an image is exported from the editor
LOAD
String Emitted when a previously saved editor serialization is loaded
SAVE
String Emitted when the current editor configuration was serialized to a document
CLOSE
String Emitted when the editor is closed
OPERATION_CREATED
String Emitted when an Operation is created
OPERATION_UPDATED
String Emitted when an Operation is updated
OPERATION_REMOVED
String Emitted when an Operation is removed
EDITOR_READY
String Emitted when the editor has finished loading and is ready to be used
WINDOW_RESIZE
String Emitted when the window (not the editor) is resized
EDITOR_RESIZE
String Emitted when the editor is resized
ZOOM
String Emitted when the editor image zoom level starts changing
ZOOM_CHANGED
String Emitted every time the editor image zoom level changes
ZOOM_DONE
String Emitted when the zoom level has finished changing
HISTORY_UNDO
String Emitted after the last edit operation is undone
HISTORY_UPDATED
String Emitted when the edit history is updated with a new snapshot
HISTORY_REDO
String Emitted after the previously undone operation is reapplied
HISTORY_BEFORE_REDO
String Emitted before the previously undone operation is reapplied
FEATURES_DISABLED
String Emitted when editor features have been disabled
FEATURES_ENABLED
String Emitted when editor features have been enabled
FEATURES_UPDATED
String Emitted when the available editor features have changed
TEXT_SCALED
String Emitted when text is scaled in the editor
TRANSFORM_RESIZE
String Emitted when the image has been resized using the dimension inputs
TRANSFORM_REAPPLY_RATIO
String Emitted when the original transform ratio has been reapplied
TRANSFORM_AFTER_EDIT
String Emitted after the transform has been edited (resized or shifted)
ADDED_STICKER
String Emitted when a new sticker has been added to the image
SPRITES_DESELECTED
String Emitted when the selected sprite has been manually deselected in the editor (and no other sprite is selected afterwards)