Class MaterialKeyWindow

The MaterialKeyWindow implements a KeyWindow to edit Material resources.

Hierarchy (view full)

Constructors

Properties

Accessors

Methods

Events

Constructors

Properties

onMaterialPropertyModified: ((resource: Resource) => void)

Invoked when the user modified the material in the UI.

Type declaration

    • (resource): void
    • Parameters

      • resource: Resource

        The material resource

      Returns void

onPreviewSceneInitialized: (() => void)

Invoked when the preview scene has been fully initialized.

onResourceDirtyChanged: ((resource: Resource, isDirty: boolean) => void)

Invoked when a resource changed its dirty state.

onViewportSettingsModified: ((viewportCameraSettings: ViewportCameraSettings) => void)

Invoked when the viewport camera settings have been modified.

Type declaration

    • (viewportCameraSettings): void
    • Parameters

      Returns void

Accessors

  • get dpiScale(): number
  • Returns the DPI scale factor.

    Returns number

    The DPI scale is in relation to a 1x base resolution of 75 DPI.

  • get height(): number
  • Sets the height of the window in points.

    Returns number

  • set height(value): void
  • Parameters

    • value: number

    Returns void

  • get heightInPixels(): number
  • Sets the height of the window in pixels.

    Returns number

  • set heightInPixels(value): void
  • Parameters

    • value: number

    Returns void

  • get icon(): Image
  • Gets the icon for the window.

    Returns Image

  • set icon(value): void
  • Gets the icon for the window.

    Parameters

    Returns void

  • get isActive(): boolean
  • Determines if the key window's tab is visible.

    Returns boolean

  • set isActive(value): void
  • Parameters

    • value: boolean

    Returns void

  • get isDestroyed(): boolean
  • Determines whether the window has been destroyed or not.

    Returns boolean

  • get isFocused(): boolean
  • Checks whether the window currently has keyboard focus.

    Returns boolean

  • set isFocused(value): void
  • Parameters

    • value: boolean

    Returns void

  • get isMaterialDirty(): boolean
  • Determines if the material is dirty.

    Returns boolean

  • get left(): number
  • Returns the X position of the window in screen coordinates in points.

    Returns number

  • get localShortcutContext(): ShortcutContext
  • Specifies the local shortcut context. This context will be automatically disabled whenever the user switches focus from the context.

    Returns ShortcutContext

  • get owningContainerWindow(): EditorWindow
  • Gets the window of the owning container. The owning container is window that serves as the host for one or multiple key windows.

    Returns EditorWindow

  • get position(): Immutable<Vector2>
  • Determines the position in which the key window is, in screen coordinates.

    Returns Immutable<Vector2>

  • get renderWindow(): RenderWindow
  • Gets the RenderWindow associated with this EditorWindow.

    Returns RenderWindow

  • get shortcutContext(): ShortcutContext
  • Specifies the global shortcut context. This context will be always enabled as long as the window is active.

    Returns ShortcutContext

  • get toolBar(): UIToolBar
  • Gets the primary tool bar element.

    Returns UIToolBar

  • get top(): number
  • Returns the X position of the window in screen coordinates in points.

    Returns number

  • get undoRedo(): UndoRedo
  • Get the local undo redo of the key window.

    Returns UndoRedo

  • get width(): number
  • Sets the width of the window in points.

    Returns number

  • set width(value): void
  • Parameters

    • value: number

    Returns void

  • get widthInPixels(): number
  • Sets the width of the window in pixels.

    Returns number

  • set widthInPixels(value): void
  • Parameters

    • value: number

    Returns void

  • get windowTitle(): I18N
  • Determines the human name to display on the window title or it's tab.

    Returns I18N

    A string that contains a human readable name for the key window.

  • set windowTitle(value): void
  • Parameters

    Returns void

  • get current(): KeyWindow
  • The currently active key window. Usually this value is null, but can be set to the current window inside an Update call or when calling an event callback for menu or toolbar items.

    Returns KeyWindow

Methods

  • Begins the tutorial for the key window.

    Returns void

  • Centers the window within it's parent window.

    Returns void

  • Virtual

    Closes the key window.

    Returns void

  • Creates a new EditorWindow for usage on this KeyWindow. If the window was already opened before, the window won't be made visible.

    Parameters

    • windowType: Type

      The type of the editor window to be created.

    Returns DockableEditorWindow

    The newly created editor window.

  • Virtual

    A method called internally after the last action is redone.

    Returns void

  • Virtual

    A method called internally after the last action is undone.

    Returns void

  • Docks the specified window to the key window. If the window does not exist yet, a new instance will be created.

    Type Parameters

    Parameters

    • type: ClassOf<T>

      Type of window to dock.

    • Optionallocation: EnumValue<DockLocation, number>

      The dock location.

    • Optionalreference: DockableEditorWindow

      The reference window. The location will determine how and where the new window will be docked.

    • OptionalrelativeSize: number

      The relative size of the new window. Setting it to 0.5, causes dockwindows to be splitted equally.

    Returns T

    Instance of the docked window.

  • Docks a new EditorWindow into the given location.

    Parameters

    • windowType: Type

      The type of the editor window to be docked.

    • location: EnumValue<DockLocation, number>

      The relative location to dock the window to, relative to reference.

    • reference: DockableEditorWindow

      The reference window. Used to determine the meaning location.

    • OptionalrelativeSize: number

      The relative size of the docked window. Setting it to 0.5, causes both the first and second window to have the same size.

    Returns DockableEditorWindow

    The editor window instance of the given type.

  • Sets the given window type as locked. Disables undocking or docking of other windows on the same space. Will also hide the tab bar and the window title.

    Type Parameters

    Parameters

    • type: ClassOf<T>

      The type that represents the window to be marked as locked.

    Returns void

  • Freezes the dockable editor window of type windowType.

    Parameters

    • windowType: Type

      The type of the window to freeze.

    Returns void

  • Virtual

    Gets whether this KeyWindow should display the User List control on the main menu title bar.

    Returns boolean

  • Virtual

    Gets whether this KeyWindow should use the main toolbar style.

    Returns boolean

  • Virtual

    Loads the key window state to the one represented by state.

    Parameters

    • stateObject: any

    Returns void

  • Locks the window to prevent it from closing.

    Returns void

  • Reverts the current material.

    Returns void

  • Saves the current material.

    Returns void

  • Virtual

    Method to override to implement destruction of custom windows. Called by the engine before the window is destroyed.

    Returns void

  • Virtual

    Method to override to implement custom behavior of a window, called by the engine once per frame.

    Returns void

  • Virtual

    Method to override to implement custom behavior of a window, called by the engine once per frame, once all the windows had their onEditorUpdate() method called.

    Returns void

  • Virtual

    Method to override to implement initialization of custom windows. Called by the engine after window creation.

    Parameters

    • options: any

    Returns void

  • Virtual

    Triggered whenever the window's screen dpi changes.

    Returns void

  • Virtual

    Triggered whenever the window gains or loses focus.

    Parameters

    • inFocus: boolean

      True if focus was gained, false otherwise.

    Returns void

  • Virtual

    Triggered whenever the window size changes.

    Parameters

    • width: number

      New width of the window in pixels.

    • height: number

      New height of the window in pixels.

    Returns void

  • Type Parameters

    Parameters

    • type: ClassOf<T>

      Type of window to open.

    • OptionalraiseWindow: boolean

      True to raise the window if already opened, but in the background.

    Returns T

    Instance of the open window.

    If the window is already open, the existing instance will be returned.

  • Brings the key window to the top.

    Returns void

  • Virtual

    Determines if the key window must be recreated when the specified module is being reloaded. This is an important task to do if the key window edits classes from the module that is being reloaded. In that case, the key window must be recreated - otherwise, it references outdated classes which results in undefined behavior that can destabilize the application.

    The following are possible modules:

    • rsx - rsx.Editor - rsx.Project - rsx.Project.Editor

    Parameters

    • moduleName: string

      The fully qualified name of the module to be reloaded.

    Returns boolean

  • Executes the last command on the redo stack (last command we called undo on), re-applying its operation.

    Returns void

  • Resets the key window layout to the default.

    Returns void

  • Invoked when the dirty state of the resource changed.

    Parameters

    • isDirty: boolean

      True if the resource is dirty.

    Returns void

    The dirty state represents whether any change happened on the resource that has not yet been persisted to disk.

  • Saves the material to its resource location.

    Parameters

    • isUserConfirmationRequired: boolean

      Determines if the user has to confirm the save operation.

    • OptionalonSuccess: (() => void)

      Action called when the operation succeeds.

        • (): void
        • Returns void

    • OptionalonFailure: (() => void)

      Action called when saving the scene failed, or the user declined to save.

        • (): void
        • Returns void

    Returns void

  • Virtual

    Saves the current key window state. This state can be persisted to disk or saved in memory and later restored by calling LoadState().

    Returns any

    An object that represents the KeyWindow saved state.

  • Changes the dirty state of the resource.

    Parameters

    • isDirty: boolean

      True if the resource is dirty.

    Returns void

    The dirty state represents whether any change happened on the resource that has not yet been persisted to disk.

  • Virtual

    Sets a predefined dockable editor window layout.

    Parameters

    Returns void

    This will override any existing windows on the current layout.

  • Defines the window maximum width and height in points.

    Parameters

    • maxWidth: number
    • maxHeight: number

    Returns void

  • Defines the window minimum width and height in points.

    Parameters

    • minWidth: number

      The minimum width of the window in points.

    • minHeight: number

      The minimum height of the window in points.

    Returns void

  • Moves the window on the desktop. Coordinates are in screen space using points.

    Parameters

    • x: number
    • y: number

    Returns void

  • Moves the window on the desktop. Coordinates are in screen space using pixels.

    Parameters

    • x: number
    • y: number

    Returns void

  • Resizes the window using a width and height in points.

    Parameters

    • width: number
    • height: number

    Returns void

  • Resizes the window using a width and height in pixels.

    Parameters

    • width: number
    • height: number

    Returns void

  • Toggles an existing toolbar button into an on or off state which changes the visuals of the button.

    Parameters

    • name: string

      Name of the existing button to toggle.

    • isToggled: boolean

      True to toggle on, false to toggle off.

    Returns void

  • Executes the last command on the undo stack, undoing its operations.

    Returns void

  • Unlocks the window to allow to be closed by the user.

    Returns void

  • Toggles an existing toolbar button into an on or off state which changes the visuals of the button.

    Parameters

    • name: string

      Name of the existing button to toggle.

    Returns void

  • Updates the toggle state of all main toolbar buttons in the toolbar.

    Returns void

  • Virtual

    A method called internally before the last action is redone.

    Returns void

  • Virtual

    A method called internally before the last action is undone.

    Returns void

  • Internal method used by the managed side to open a newly created KeyWindow object instance.

    Parameters

    • keyWindow: KeyWindow

      The key window instance.

    • state: any

    Returns void

  • Opens and creates a new KeyWindow of the specified type. If state is not null, loadState is also called with the given value for state.

    Type Parameters

    Parameters

    • type: ClassOf<T>
    • Optionalstate: any

      An optional initial state for the key window.

    Returns T

    An instance to the newly created key window.

  • Opens a new MaterialKeyWindow with the given material.

    Parameters

    • material: Material

      The Material to be loaded in the key window.

    Returns MaterialKeyWindow

    The newly created key window.

  • Opens a new MaterialKeyWindow with the given material.

    Parameters

    • materialUUID: Const<UUID>

      The Material to be loaded in the key window.

    Returns MaterialKeyWindow

    The newly created key window.

Events

onToolbarBuild: Event<[], void>

Event triggered when the toolbar is being built.

onResize: Event<[], void>

Event triggered once the window is resized.

onMove: Event<[], void>

Event triggered once the window is moved.

onClose: Event<[], void>

Event triggered when the window is closed.

onFocusChangedInternal: Event<[boolean], void>