RSX Code Reference
    Preparing search index...

    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.

    Hierarchy (View Summary)

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

    Invoked when an application error occured.

    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>,
    ) => 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: string, newPath: string): 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: string): 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;
        deployPublicTemplate: ConsoleCommand;
        ping: ConsoleCommand;
        precompileShaders: ConsoleCommand;
        unloadResources: ConsoleCommand;
        wget: ConsoleCommand;
    }

    An object containing ConsoleCommand objects registered by the editor.

    controlModifierButton: VirtualButton

    The control modifier button.

    developerButton: UIDeveloperModeButton

    The developer mode button in the key window menu bar.

    rendererViewForwardPositiveZ: true

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

    reports: {
        cpu: JsonObject;
        cpuMemory: MemoryUsage;
        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.

    • gpu: JsonObject

      The aggregated GPU profiler report. Updated every frame.

    • gpuMemory: JsonObject

      The latest GPU memory usage report.

    shiftModifierButton: VirtualButton

    The shift modifier button.

    • 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 defaultStyleSheet(): StyleSheet

      Sets the global default stylesheet applied to all UI surfaces that don't have a local override.

      Returns StyleSheet

    • set defaultStyleSheet(value: StyleSheet): void

      Sets the global default stylesheet applied to all UI surfaces that don't have a local override.

      Parameters

      Returns void

    • 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: boolean): 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: number): 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

    • 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

      Returns void

    • Schedules a function to be called the next frame, or optionally, after a delay in seconds.

      Parameters

      • fn: () => void

        The function to call.

      • OptionaldelayInSeconds: number

        The optional delay in seconds before calling the function.

      Returns void

      The order of the deferred calls is not guaranteed, and calls may be executed in a different order than they were scheduled. The only guarantee is that the function will be called after the specified delay has elapsed, and not before.

    • Schedules a function to be called the next frame, or optionally, after a delay in seconds, and returns a promise that resolves with the function's return value.

      Type Parameters

      • T

      Parameters

      • fn: () => T

        The function to call.

      • OptionaldelayInSeconds: number

        The optional delay in seconds before calling the function.

      Returns Promise<T>

      A promise that resolves with the function's return value.

      The order of the deferred calls is not guaranteed, and calls may be executed in a different order than they were scheduled. The only guarantee is that the function will be called after the specified delay has elapsed, and not before.

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

      Returns CloudProjectListing

      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

    • Opens the user account callout window anchored to

      Parameters

      Returns void

      anchor. Displays the active subscription information and a link to manage the user's Abstract ID.

    • 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

    • 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.

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

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

    onInitialized: Event<[]>

    Event triggered once the editor has been fully initialized.

    onProfilingStateChangeEditor: Event<[p0: boolean]>
    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<[]>

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

    onShutdownRequested: Event<[], boolean>

    An event fired when the engine is about to quit. Returning false will prevent the engine from exiting.

    onKeyWindowDockManagerLayoutChanged: Event<
        [keyWindow: KeyWindowBase, dockLayout: DockableEditorWindowLayout],
    >

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