Class EditorApplication

The EditorApplication is the main system that manages the lifetime of the RSX Editor. It manages global settings and state for the editor and related sub-systems.

Constructors

Properties

Accessors

Methods

Events

Constructors

Properties

onApplicationError: ((logEntry: Immutable<LogEntry>, repeatCount?: number) => void)

Invoked when an application error occured.

onEncryptedUserCredentialsChanged: ((encryptedUsername: string, encryptedPassword: string) => void)

Invoked when the encrypted user credentials changed.

Type declaration

    • (encryptedUsername, encryptedPassword): void
    • Parameters

      • encryptedUsername: string

        The encrytped username.

      • encryptedPassword: string

        The encrytped password.

      Returns void

onImportFileConsumed: ((path: FilePath) => void)

Called whenever an import finishes and the imported file is no longer needed.

onKeyWindowCloudSyncButtonClicked: ((cloudButton: UIButton) => void)

Invoked when the user clicks on the cloud Sync button, part of the key window container header.

onKeyWindowDiscussionButtonClicked: ((discussionButton: UIButton) => void)

Invoked when the user clicks on the project discussion button, part of the key window container header.

onKeyWindowNotificationButtonClicked: ((notificationButton: UIButton) => void)

Invoked when the user clicks on the notiications button, part of the key window container header.

onProjectLibraryEntryModified: ((entryPath: LibraryIdentifierPath, operationName: string, operationType: EnumValue<LibrarySubOperationType, number>) => void)

Invoked when a resource in the project library has been modified by a library operation.

Type declaration

onProjectLibraryEntryMovedOrRenamed: ((oldPath: string, newPath: string) => void)

Invoked when an entry in the library is moved or renamed.

Type declaration

    • (oldPath, newPath): void
    • Parameters

      • oldPath: string

        The old path of the entry, relative to the project library.

      • newPath: string

        The new path of the entry, relative to the project library.

      Returns void

onProjectLibraryImportFailed: ((errors: ResourceImportError[]) => void)

Invoked when resource import operations failed.

onProjectLoad: (() => void)

Invoked when the project has been loaded.

onProjectUnload: (() => void)

Invoked when the project has been unloaded.

onTooltipHide: (() => void)
onUserTokenChanged: ((newToken: string) => void)

Invoked when the User Token changes.

Type declaration

    • (newToken): void
    • Parameters

      • newToken: string

        The new user token. Empty if loged out.

      Returns void

altModifierButton: VirtualButton

The alt modifier button.

browserImportFilePrefixPath: FilePath

A constant prefix file path where imported files are temporarily placed at.

consoleCommands: {
    clear: ConsoleCommand;
    ping: ConsoleCommand;
    precompileShaders: ConsoleCommand;
    unloadResources: ConsoleCommand;
    wget: ConsoleCommand;
}

An object containing ConsoleCommand objects registered by the editor.

controlModifierButton: VirtualButton

The control modifier button.

rendererViewForwardPositiveZ = false

Denotes it view-based objects such as cameras and lights consider forward the positive Z axis.

reports: {
    cpu: JsonObject;
    cpuMemory: MemoryUsage;
    editorCamera: JsonObject;
    gpu: JsonObject;
    gpuMemory: JsonObject;
}

Performance diagnostic reports.

Type declaration

  • cpu: JsonObject

    The aggregated CPU profiler report. Updated every frame.

  • cpuMemory: MemoryUsage

    The latest memory usage report.

  • editorCamera: JsonObject

    The editor camera specific data.

  • gpu: JsonObject

    The aggregated GPU profiler report. Updated every frame.

  • gpuMemory: JsonObject

    The latest GPU memory usage report.

shiftModifierButton: VirtualButton

The shift modifier button.

Accessors

  • get applicationCache(): LocalCache
  • Returns a cache that can be used for storing application-wide data.

    Returns LocalCache

  • get buildDataPath(): FilePath
  • Gets the build data path

    Returns FilePath

  • get cloudProject(): CloudProject
  • Returns the name of the currently loaded project.

    Returns CloudProject

  • get dataPath(): FilePath
  • Absolute path containing the RSX "Data" directory.

    Returns FilePath

  • get editorBuildStamp(): string
  • Returns the editor build stamp.

    Returns string

  • get editorModuleName(): string
  • Name of the builtin module containing editor specific types.

    Returns string

  • get editorVersion(): string
  • The engine version.

    Returns string

  • get engineModuleName(): string
  • Name of the builtin module containing engine specific types.

    Returns string

  • get frameworkBuildStamp(): string
  • Returns the framework build stamp.

    Returns string

  • get frameworkVersion(): string
  • The engine version.

    Returns string

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

    Returns boolean

  • get isProfilingEnabled(): boolean
  • Enables or disables global profiling.

    Returns boolean

  • set isProfilingEnabled(value): void
  • Parameters

    • value: boolean

    Returns void

  • get isStagingEnvironment(): boolean
  • Returns whether the editor is running on a staging environment.

    Returns boolean

  • get maximumFramesPerSecond(): number
  • Changes the maximum frames per second the application is allowed to run in. 0 means unlimited.

    Returns number

  • set maximumFramesPerSecond(value): void
  • Parameters

    • value: number

    Returns void

  • get projectCache(): LocalCache
  • Returns a cache that can be used for storing project specific data. Note the concept of projects is only relevant when in the editor and a project is loaded. Otherwise this will return the same cache as GetApplicationCache().

    Returns LocalCache

  • get projectName(): string
  • Name of the currently open project.

    Returns string

  • get projectPath(): FilePath
  • Absolute path to the folder containing the currently open project.

    Returns FilePath

  • get projectUUID(): UUID
  • Returns the name of the currently loaded project.

    Returns UUID

  • get scriptEditorModuleName(): string
  • Name of the custom module compiled from editor scripts within the project.

    Returns string

  • get scriptGameModuleName(): string
  • Name of the custom module compiled from non-editor scripts within the project.

    Returns string

  • get userDataPath(): FilePath
  • Returns the path to a user data directory where we the engine can read or write persistent files.

    Returns FilePath

    When executing the runtime, the likely path is AppData on Windows or Library/Application Support on MacOS When executing the editor, the likely path is Documents/RSXEngine.

  • get version(): string
  • Returns the current application version.

    Returns string

Methods

  • Called every frame by the runtime.

    Returns void

  • Show a browse dialog to select a path to create a new scene.

    Parameters

    • onSuccess: ((scene: Scene, sceneLibraryPath: string) => void)
        • (scene, sceneLibraryPath): void
        • Parameters

          • scene: Scene
          • sceneLibraryPath: string

          Returns void

    Returns void

  • Executes the given delegate on the main thread with the specified delayInSeconds.

    Parameters

    • delegate: (() => void)

      The delegate to be called from the main thread.

        • (): void
        • Returns void

    • delayInSeconds: number

      The delay in seconds.

    Returns void

  • Lists all projects that the current user has checked out locally.

    Returns CloudProject[]

    If the user is not logged in, or in offline mode, this method will return no data and log a warning.

  • Gets the latest report of GPU memory usage.

    Returns JsonObject

  • Handles commandline arguments during startup.

    Returns boolean

  • Determines if the resourceUUID is contained in the inital cloud sync catalog.

    Parameters

    Returns boolean

    This API should only be used during the editor startup. Once the editor has been fully initialized it is recommended to use the corresponding APIs of the CloudLibraryWatchdog class instead.

  • Opens a dialog that shows about RSXEngine.

    Returns void

  • Calculates and logs the GPU memory usage.

    Returns void

  • Close the focussed window.

    Returns void

  • An event fired whenever a new MessagePort connection is opened.

    Parameters

    • port: MessagePort

      The newly connected port.

    Returns void

  • Creates a new empty scene, shows a dialog to select the path for the new scene.

    Returns void

  • Opens the account settings.

    Returns void

  • Opens the RSXEngine URL.

    Returns void

  • Opens a dialog that allows the user to select a new template to load as the current scene. If current scene is modified the user is offered a chance to save it.

    Parameters

    • OptionalignoreSave: boolean

    Returns void

  • Precalculates all shaders.

    Returns void

  • Quits the application.

    Returns void

  • Saves all data in the currently open project.

    Returns void

  • Signs the current account out.

    Returns void

  • Invoked when the user wants to submit pending crash reports.

    Returns void

  • Opens a dialog with custom save options.

    Parameters

    • OptionaltextLength: number
    • OptionalincludeCustomControl: boolean

    Returns void

  • Calculates and logs the GPU memory usage.

    Parameters

    • OptionaltextLength: number
    • OptionalincludeCustomControl: boolean

    Returns void

  • Toggles the profiling system.

    Returns void

  • Updates all scene heads to the latest version.

    Returns void

  • Opens a URL. The url can be a web URL or a file system URL.

    Parameters

    • url: string

      The URL to open.

    Returns void

  • Closes the editor.

    Returns void

  • Registers the global console commands.

    Returns void

  • Register the global editor application input configuration and buttons.

    Returns void

  • Reloads all script assemblies in case they were modified. This action is delayed and will be executed at the beginning of the next frame.

    Returns void

  • Restarts the editor.

    Returns void

  • Restores a previously persisted key window layout.

    Returns boolean

  • Executes any editor-specific unit tests. This should be called after a project is loaded if possible.

    Returns void

  • Saves the currently loaded scene to the specified path.

    Parameters

    • sceneInstance: SceneInstance

      The scene instance to save.

    • path: string

      Path relative to the resource folder. This can be the path to the existing scene template if it just needs updating.

    Returns Scene

    The saved Scene resource.

  • Locates unsubmitted crash reports located in the CrashReports user data folder. If crash reports are found, the user is prompted to submit the report. Unsubmitted records are offered to be removed.

    Parameters

    • showNoReportsMessage: boolean

    Returns void

    This requires an internet connection.

Events

onSceneViewportRedrawRequested: Event<[Const<SceneViewportRedrawRequest>], void>

Event triggered when a changed happen to notify viewports that they should redraw.

onProfilingStateChangeEditor: Event<[boolean], void>
onDomainReloadRequested: Event<[], boolean>

An event that fires whenever a domain reload is requested. This event allows subscribers to block a domain reload request by returning false.

If any subscriber returns false, the domain reload is suspended for 1 second and after that time has elapsed, a new call to the event will be sent.

onDomainReloadBlocked: Event<[], void>

An event called whenever domain reload is blocked by a subscriber of OnDomainReloadRequested.

onKeyWindowDockManagerLayoutChanged: Event<[KeyWindowBase, DockableEditorWindowLayout], void>

An event fired whenever the layout for a key window changes.