FilesInput

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

Hierarchy

  • FilesInput

Index

Constructors

constructor

Find examples in Playground
  • new FilesInput(engine: Engine, scene: Scene, sceneLoadedCallback: function, progressCallback: function, additionalRenderLoopLogicCallback: function, textureLoadingCallback: function, startingProcessingFilesCallback: function, onReloadCallback: function, errorCallback: function): FilesInput
  • Creates a new FilesInput

    Parameters

    • engine: Engine

      defines the rendering engine

    • scene: Scene

      defines the hosting scene

    • sceneLoadedCallback: function

      callback called when scene is loaded

        • (sceneFile: File, scene: Scene): void
        • Parameters

          • sceneFile: File
          • scene: Scene

          Returns void

    • progressCallback: function

      callback called to track progress

    • additionalRenderLoopLogicCallback: function

      callback called to add user logic to the rendering loop

        • (): void
        • Returns void

    • textureLoadingCallback: function

      callback called when a texture is loading

        • (remaining: number): void
        • Parameters

          • remaining: number

          Returns void

    • startingProcessingFilesCallback: function

      callback called when the system is about to process all files

        • (files?: File[]): void
        • Parameters

          • Optional files: File[]

          Returns void

    • onReloadCallback: function

      callback called when a reload is requested

        • (sceneFile: File): void
        • Parameters

          • sceneFile: File

          Returns void

    • errorCallback: function

      callback call if an error occurs

        • (sceneFile: File, scene: Scene, message: string): void
        • Parameters

          • sceneFile: File
          • scene: Scene
          • message: string

          Returns void

    Returns FilesInput

Properties

onProcessFileCallback

Find examples in Playground
onProcessFileCallback: function

Callback called when a file is processed

Type declaration

    • (file: File, name: string, extension: string): true
    • Parameters

      • file: File
      • name: string
      • extension: string

      Returns true

Static FilesToLoad

Find examples in Playground
FilesToLoad: object

List of files ready to be loaded

Type declaration

  • [key: string]: File

Methods

dispose

Find examples in Playground
  • dispose(): void
  • Release all associated resources

    Returns void

loadFiles

Find examples in Playground
  • loadFiles(event: any): void
  • Load files from a drop event

    Parameters

    • event: any

      defines the drop event to use as source

    Returns void

monitorElementForDragNDrop

Find examples in Playground
  • 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

Find examples in Playground
  • reload(): void
  • Reload the current scene from the loaded files

    Returns void

Generated using TypeDoc