Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FilesInput

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

Hierarchy

  • FilesInput

Index

Constructors

constructor

  • Creates a new FilesInput

    Parameters

    • 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

Properties

loadAsyncSearch playground for loadAsync

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

Function used when loading the scene file

param
param

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

Accessors

filesToLoad

  • 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

Methods

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

    Parameters

    • 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

    Parameters

    • 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

Legend

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