• Public
  • Public/Protected
  • All

Class FilesInput

Class used to help managing file picking and drag-n-drop


  • FilesInput




  • Creates a new FilesInput


    • engine: Engine

      defines the rendering engine

    • scene: Nullable<Scene>

      defines the hosting scene

    • sceneLoadedCallback: Nullable<(sceneFile: File, scene: Scene) => void>

      callback called when scene is loaded

    • progressCallback: Nullable<(progress: ISceneLoaderProgressEvent) => void>

      callback called to track progress

    • additionalRenderLoopLogicCallback: Nullable<() => void>

      callback called to add user logic to the rendering loop

    • textureLoadingCallback: Nullable<(remaining: number) => void>

      callback called when a texture is loading

    • startingProcessingFilesCallback: Nullable<(files?: File[]) => void>

      callback called when the system is about to process all files

    • onReloadCallback: Nullable<(sceneFile: File) => void>

      callback called when a reload is requested

    • errorCallback: Nullable<(sceneFile: File, scene: Nullable<Scene>, message: string) => void>

      callback call if an error occurs

    Returns FilesInput


loadAsyncSearch playground for loadAsync

loadAsync: (sceneFile: File, onProgress: Nullable<(event: ISceneLoaderProgressEvent) => void>) => Promise<Scene>

Function used when loading the scene file

Type declaration

onProcessFileCallbackSearch playground for onProcessFileCallback

onProcessFileCallback: (file: File, name: string, extension: string, setSceneFileToLoad: (sceneFile: File) => void) => boolean

Callback called when a file is processed

Type declaration

    • (file: File, name: string, extension: string, setSceneFileToLoad: (sceneFile: File) => void): boolean
    • Parameters

      • file: File
      • name: string
      • extension: string
      • setSceneFileToLoad: (sceneFile: File) => void
          • (sceneFile: File): void
          • Parameters

            • sceneFile: File

            Returns void

      Returns boolean



  • get filesToLoad(): File[]
  • Gets the current list of files to load

    Returns File[]

Static FilesToLoad

  • get FilesToLoad(): {}
  • List of files ready to be loaded

    Returns {}

    • [key: string]: File


disposeSearch playground for dispose

  • dispose(): void
  • Release all associated resources

    Returns void

loadFilesSearch playground for loadFiles

  • loadFiles(event: any): void
  • Load files from a drop event


    • event: any

      defines the drop event to use as source

    Returns void

monitorElementForDragNDropSearch playground for monitorElementForDragNDrop

  • monitorElementForDragNDrop(elementToMonitor: HTMLElement): void
  • Calls this function to listen to drag'n'drop events on a specific DOM element


    • elementToMonitor: HTMLElement

      defines the DOM element to track

    Returns void

reloadSearch playground for reload

  • reload(): void
  • Reload the current scene from the loaded files

    Returns void


  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method