Skip to content

Settings

All keys listed below can be modified through the Editor API. The nested settings inside UBQSettings can be reached via key paths, e.g. page/title/show.

Settings

BlockAnimationSettings

MemberTypeDefaultDescription
enabledbooltrueWhether animations should be enabled or not.

CameraClampingSettings

MemberTypeDefaultDescription
overshootModeCameraClampingOvershootModeReverseControls what happens when the clamp area is smaller than the viewport. Center: the clamp area is centered in the viewport. Reverse: the clamp area can move inside the viewport until it hits the edges.

CameraSettings

MemberTypeDefaultDescription
clampingCameraClampingSettings: CameraClampingOvershootMode overshootMode{}Clamping settings for the camera.

ControlGizmoSettings

MemberTypeDefaultDescription
blockScaleDownLimitfloat8.0Scale-down limit for blocks in screen pixels when scaling them with the gizmos or with touch gestures. The limit is ensured to be at least 0.1 to prevent scaling to size zero.
showCropHandlesbool{true}Whether or not to show the handles to adjust the crop area during crop mode.
showCropScaleHandlesbool{true}Whether or not to display the outer handles that scale the full image during crop.
showMoveHandlesbool{true}Whether or not to show the move handles.
showResizeHandlesbool{true}Whether or not to display the non-proportional resize handles (edge handles)
showRotateHandlesbool{true}Whether or not to show the rotation handles.
showScaleHandlesbool{true}Whether or not to display the proportional scale handles (corner handles)

DebugFlags

Flags that control debug outputs.

MemberTypeDefaultDescription
enforceScopesInAPIsboolfalseWhether APIs calls that perform edits should throw errors if the corresponding scope does not allow the edit.
showHandlesInteractionAreabool{false}Display the interaction area around the handles.
useDebugMipmapsboolfalseEnable the use of colored mipmaps to see which mipmap is used.

MouseSettings

MemberTypeDefaultDescription
enableScrollbooltrueWhether the engine processes mouse scroll events.
enableZoombooltrueWhether the engine processes mouse zoom events.

PageSettings

MemberTypeDefaultDescription
allowCropInteractionbooltrueIf crop interaction (by handles and gestures) should be possible when the enabled arrangements allow resizing.
allowMoveInteractionboolfalseIf move interaction (by handles and gestures) should be possible when the enabled arrangements allow moving and if the page layout is not controlled by the scene, e.g., in a ‘VerticalStack’.
allowResizeInteractionboolfalseIf a resize interaction (by handles and gestures) should be possible when the enabled arrangements allow resizing.
allowRotateInteractionboolfalseIf rotation interaction (by handles and gestures) should be possible when the enabled arrangements allow rotation and if the page layout is not controlled by the scene, e.g., in a ‘VerticalStack’.
dimOutOfPageAreasbooltrueWhether the opacity of the region outside of all pages should be reduced.
innerBorderColorColorcreateRGBColor(0.0, 0.0, 0.0, 0.0)Color of the inner frame around the page.
marginFillColorColorcreateRGBColor(0.79, 0.12, 0.40, 0.1)Color of frame around the bleed margin area of the pages.
marginFrameColorColorcreateRGBColor(0.79, 0.12, 0.40, 0.0)Color filled into the bleed margins of pages.
moveChildrenWhenCroppingFillboolfalseWhether the children of the page should be transformed to match their old position relative to the page fill when a page fill is cropped.
outerBorderColorColorcreateRGBColor(1.0, 1.0, 1.0, 0.0)Color of the outer frame around the page.
restrictResizeInteractionToFixedAspectRatioboolfalseIf the resize interaction should be restricted to fixed aspect ratio resizing.
titlePageTitleSettings(bool show, bool showOnSinglePage, bool showPageTitleTemplate, bool appendPageName, string separator, Color color, string fontFileUri)Page title settings.

PageTitleSettings

MemberTypeDefaultDescription
appendPageNamebooltrueWhether to append the page name to the title if a page name is set even if the name is not specified in the template or the template is not shown
colorColorcreateRGBColor(1., 1., 1.)Color of page titles visible in preview mode, can change with different themes.
fontFileUristringDEFAULT_FONTFont of page titles.
separatorstring"-"Title label separator between the page number and the page name.
showbooltrueWhether to show titles above each page.
showOnSinglePagebooltrueWhether to hide the the page title when only a single page is given.
showPageTitleTemplatebooltrueWhether to include the default page title from page.titleTemplate

PlaceholderControlsSettings

MemberTypeDefaultDescription
showButtonbooltrueShow the placeholder button.
showOverlaybooltrueShow the overlay pattern.

Settings

MemberTypeDefaultDescription
alwaysHighlightPlaceholdersboolfalseWhether placeholder elements should always be highlighted in the scene.
basePathstring""The root directory to be used when resolving relative paths or when accessing bundle:// URIs on platforms that don’t offer bundles.
blockAnimationsBlockAnimationSettings: bool enabled{}Settings that configure the behavior of block animations.
borderOutlineColorColorcreateRGBColor(0., 0., 0., 1.0)The border outline color, defaults to black.
cameraCameraSettings: CameraClampingSettings clamping{}Settings that configure the behavior of the camera.
clearColorColorcreateClear()The color with which the render target is cleared before scenes get rendered. Only used while renderMode == Preview, else #00000000 (full transparency) is used.
colorMaskingSettingsColorMaskingSettings(Color maskColor, bool secondPass){}A collection of settings used to perform color masking.
controlGizmoControlGizmoSettings(bool showCropHandles, bool showCropScaleHandles, bool showMoveHandles, bool showResizeHandles, bool showScaleHandles, bool showRotateHandles, float blockScaleDownLimit){}Settings that configure which touch/click targets for move/scale/rotate/etc. are enabled and displayed.
cropOverlayColorColorcreateRGBColor(0., 0., 0., 0.39)Color of the dimming overlay that’s added in crop mode.
debugDebugFlags(bool useDebugMipmaps, bool showHandlesInteractionArea, bool enforceScopesInAPIs){}?
defaultEmojiFontFileUristringEMOJI_FONTURI of default font file for emojis.
defaultFontFileUristringDEFAULT_FONTURI of default font file This font file is the default everywhere unless overriden in specific settings.
doubleClickSelectionModeDoubleClickSelectionModeHierarchicalThe current mode of selection on double-click.
doubleClickToCropEnabledbooltrueWhether double clicking on an image element should switch into the crop editing mode.
emscriptenCORSConfigurationsvector< CORSConfiguration >{}CORS Configurations: <origin, value> pairs. See FetchAsyncService-emscripten.cpp for details.
errorStateColorColorcreateRGBColor(1., 1., 1., 0.7)The error state color for design blocks.
fallbackFontUristring""The URI of the fallback font to use for text that is missing certain characters.
forceSystemEmojisbooltrueWhether the system emojis should be used for text.
globalScopesGlobalScopes(Text text, Fill fill, Stroke stroke, Shape shape, Layer layer, Appearance appearance, Lifecycle lifecycle, Editor editor)Allow)Global scopes.
handleFillColorColorcreateWhite()The fill color for handles.
highlightColorColorcreateRGBColor(0.2, 85. / 255., 1.)Color of the selection, hover, and group frames and for the handle outlines for non-placeholder elements.
licensestring""A valid license string in JWT format.
maxImageSizeint4096The maximum size at which images are loaded into the engine. Images that exceed this size are down-scaled prior to rendering. Reducing this size further reduces the memory footprint. Defaults to 4096x4096.
mouseMouseSettings(bool enableZoom, bool enableScroll){}Settings that configure the behavior of the mouse.
pagePageSettings(PageTitleSettings title, Color marginFillColor, Color marginFrameColor, Color innerBorderColor, Color outerBorderColor, bool dimOutOfPageAreas, bool allowCropInteraction, bool allowResizeInteraction, bool restrictResizeInteractionToFixedAspectRatio, bool allowRotateInteraction, bool allowMoveInteraction, bool moveChildrenWhenCroppingFill){}Page related settings.
placeholderControlsPlaceholderControlsSettings(bool showOverlay, bool showButton){}Supersedes how the blocks’ placeholder controls are applied.
placeholderHighlightColorColorcreateRGBColor(0.77, 0.06, 0.95)Color of the selection, hover, and group frames and for the handle outlines for placeholder elements.
positionSnappingThresholdfloat4.Position snapping threshold in screen space.
progressColorColorcreateRGBColor(1., 1., 1., 0.7)The progress indicator color.
renderTextCursorAndSelectionInEnginebooltrueWhether the engine should render the text cursor and selection highlights during text editing. This can be set to false, if the platform wants to perform this rendering itself.
rotationSnappingGuideColorColorcreateRGBColor(1., 0.004, 0.361)Color of the rotation snapping guides.
rotationSnappingThresholdfloat0.15Rotation snapping threshold in radians.
ruleOfThirdsLineColorColorcreateRGBColor(0.75, 0.75, 0.75, 0.75)Color of the rule-of-thirds lines.
showBuildVersionboolfalseShow the build version on the canvas.
snappingGuideColorColorcreateRGBColor(1., 0.004, 0.361)Color of the position snapping guides.
textVariableHighlightColorColorcreateRGBColor(0.7, 0., 0.7)Color of the text variable highlighting borders.
touchTouchSettings(bool dragStartCanSelect, bool singlePointPanning, PinchGestureAction pinchAction, RotateGestureAction rotateAction){}Settings that configure which touch gestures are enabled and which actions they trigger.
useSystemFontFallbackboolfalseWhether the IMG.LY hosted font fallback is used for fonts that are missing certain characters, covering most of the unicode range.

TouchSettings

MemberTypeDefaultDescription
dragStartCanSelectbooltrueWhether dragging an element requires selecting it first. When not set, elements can be directly dragged.
pinchActionPinchGestureActionScaleThe action to perform when a pinch gesture is performed.
rotateActionRotateGestureActionRotateWhether or not the two finger turn gesture can rotate selected elements.
singlePointPanningbooltrueWhether or not dragging on the canvas should move the camera (scrolling). When not set, the scroll bars have to be used. This setting might get overwritten with the feature flag preventScrolling.

Change Settings

In this example, we will show you how to use the CreativeEditor SDK’s CreativeEngine to control with the editor API. A list of all available settings can be found above.

Exploration

findAllSettings(): string[]

Returns a list of all the settings available.

  • Returns A list of settings keypaths.
getSettingType(keypath: string): SettingType

Returns the type of a setting.

  • keypath: The settings keypath, e.g. doubleClickSelectionMode.
  • Returns The setting type.

Functions

onSettingsChanged: (callback: () => void) => (() => void)

Subscribe to changes to the editor settings.

  • callback: This function is called at the end of the engine update, if the editor settings have changed.
  • Returns A method to unsubscribe.
onRoleChanged: (callback: (role: RoleString) => void) => (() => void)

Subscribe to changes to the editor role. This lets you react to changes in the role of the user and update engine and editor settings in response.

  • callback: This function will be called immediately after a role has been set and the default settings for that role have been applied. This function will also be called in case the role is set to the same value as before.
  • Returns A function for unsubscribing
setSettingBool(keypath: SettingsBool, value: boolean): void

Set a boolean setting.

  • keypath: The settings keypath, e.g. doubleClickToCropEnabled
  • value: The value to set.
  • Throws An error, if the keypath is invalid.
setSettingBool(keypath: `ubq://${SettingsBool}`, value: boolean): void

Support for ubq:// prefixed keypaths will be removed in a future release.

getSettingBool(keypath: SettingsBool): boolean

Get a boolean setting.

  • keypath: The settings keypath, e.g. doubleClickToCropEnabled
  • Throws An error, if the keypath is invalid.
getSettingBool(keypath: `ubq://${SettingsBool}`): boolean

Support for ubq:// prefixed keypaths will be removed in a future release.

setSettingInt(keypath: string, value: number): void

Set an integer setting.

  • keypath: The settings keypath.
  • value: The value to set.
  • Throws An error, if the keypath is invalid.
getSettingInt(keypath: string): number

Get an integer setting.

  • keypath: The settings keypath.
  • Throws An error, if the keypath is invalid.
setSettingFloat(keypath: SettingsFloat, value: number): void

Set a float setting.

  • keypath: The settings keypath, e.g. positionSnappingThreshold
  • value: The value to set.
  • Throws An error, if the keypath is invalid.
setSettingFloat(keypath: `ubq://${SettingsFloat}`, value: number): void

Support for ubq:// prefixed keypaths will be removed in a future release.

getSettingFloat(keypath: SettingsFloat): number

Get a float setting.

  • keypath: The settings keypath, e.g. positionSnappingThreshold
  • Throws An error, if the keypath is invalid.
getSettingFloat(keypath: `ubq://${SettingsFloat}`): number

Support for ubq:// prefixed keypaths will be removed in a future release.

setSettingString(keypath: SettingsString, value: string): void

Set a string setting.

  • keypath: The settings keypath, e.g. license
  • value: The value to set.
  • Throws An error, if the keypath is invalid.
setSettingString(keypath: `ubq://${SettingsString}`, value: string): void

Support for ubq:// prefixed keypaths will be removed in a future release.

getSettingString(keypath: SettingsString): string

Get a string setting.

  • keypath: The settings keypath, e.g. license
  • Throws An error, if the keypath is invalid.
getSettingString(keypath: `ubq://${SettingsString}`): string

Support for ubq:// prefixed keypaths will be removed in a future release.

setSettingColor(keypath: SettingsColor, value: Color): void

Set a color setting.

  • keypath: The settings keypath, e.g. highlightColor.
  • value: The The value to set.
setSettingColor(keypath: `ubq://${SettingsColor}`, value: Color): void

Support for ubq:// prefixed keypaths will be removed in a future release.

getSettingColor(keypath: SettingsColor): Color

Get a color setting.

  • keypath: The settings keypath, e.g. highlightColor.
  • Throws An error, if the keypath is invalid.
getSettingColor(keypath: `ubq://${SettingsColor}`): Color

Support for ubq:// prefixed keypaths will be removed in a future release.

setSettingEnum<T extends keyof SettingsEnum>(keypath: T, value: SettingsEnum[T]): void

Set an enum setting.

  • keypath: The settings keypath, e.g. doubleClickSelectionMode.
  • value: The enum value as string.
setSettingEnum<T extends keyof SettingsEnum>(keypath: `ubq://${T}`, value: SettingsEnum[T]): void

Support for ubq:// prefixed keypaths will be removed in a future release.

getSettingEnum<T extends keyof SettingsEnum>(keypath: T): SettingsEnum[T]

Get an enum setting.

  • keypath: The settings keypath, e.g. doubleClickSelectionMode.
  • Returns The value as string.
getSettingEnum<T extends keyof SettingsEnum>(keypath: `ubq://${T}`): SettingsEnum[T]

Support for ubq:// prefixed keypaths will be removed in a future release.

getSettingEnumOptions<T extends keyof SettingsEnum>(keypath: T): string[]

Get the possible enum options for a given enum setting.

  • keypath: The settings keypath, e.g. doubleClickSelectionMode.
  • Returns The possible enum options as strings.
getSettingEnumOptions<T extends keyof SettingsEnum>(keypath: `ubq://${T}`): string[]

Support for ubq:// prefixed keypaths will be removed in a future release.

getRole(): RoleString

Get the current role of the user

setRole(role: RoleString): void

Set the role of the user and apply role-dependent defaults for scopes and settings

Full Code

Here’s the full code:

engine.editor.findAllSettings();
engine.editor.getSettingType('doubleClickSelectionMode');
const unsubscribeSettings = engine.editor.onSettingsChanged(() =>
console.log('Editor settings have changed');
);
const unsubscribeRoleChange = engine.editor.onRoleChanged((role) => {
console.log('Role': role);
});
engine.editor.setSettingBool('doubleClickToCropEnabled', true);
engine.editor.getSettingBool('doubleClickToCropEnabled');
engine.editor.setSettingInt('integerSetting', 0);
engine.editor.getSettingInt('integerSetting');
engine.editor.setSettingFloat('positionSnappingThreshold', 2.0);
engine.editor.getSettingFloat('positionSnappingThreshold');
engine.editor.setSettingString('license', 'invalid');
engine.editor.getSettingString('license');
engine.editor.setSettingColor('highlightColor', { r: 1, g: 0, b: 1, a: 1 }); // Pink
engine.editor.getSettingColor('highlightColor');
engine.editor.setSettingEnum('doubleClickSelectionMode', 'Direct');
engine.editor.getSettingEnum('doubleClickSelectionMode');
engine.editor.getSettingEnumOptions('doubleClickSelectionMode');
engine.editor.getRole();
engine.editor.setRole('Adopter');