Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Hierarchy

  • FilesInput

Index

Constructors

  • 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 (files provided) 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

    • Optional useAppend: boolean

      defines if the file loaded must be appended (true) or have the scene replaced (false, default behavior)

    Returns FilesInput

Properties

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

Type declaration

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

Type declaration

    • (file: File, name: string, extension: string, setSceneFileToLoad: ((sceneFile: File) => void)): boolean
    • Callback called when a file is processed

      Parameters

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

            • sceneFile: File

            Returns void

      Returns boolean

useAppend: boolean

Accessors

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

    Returns File[]

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

    Returns {}

    • [key: string]: File

Methods

  • dispose(): void
  • Release all associated resources

    Returns void

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

    Parameters

    • event: any

      defines the drop event to use as source

    Returns void

  • 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

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

    Returns void

Legend

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

Settings

Theme