File
Defined in: system/file.ts:21
Class for adding files (such as images and media) from your file system to the stage.
Basic Usage
Section titled “Basic Usage”var XJS = require('xjs');var File = XJS.File;
var filePromise = new File('C:\\Users\\Public\\Music\\song.mp3').addToScene();Implements
Section titled “Implements”Addable
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new File(
file):File
Defined in: system/file.ts:29
param: (file: string)
Creates a File object pertaining to a file’s full path.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”File
Methods
Section titled “Methods”addToScene()
Section titled “addToScene()”addToScene(
value?):Promise<any>
Defined in: system/file.ts:47
param: (value?: number | Scene)
return: Promise<any>Adds this file to the current scene by default. Accepts an optional parameter value, which, when supplied, points to the scene where item will be added instead. If ready config {listenToItemAdd: true} it returns item id, else returns boolean.
Note: There is yet no way to detect error responses for this action.
Parameters
Section titled “Parameters”value?
Section titled “value?”number | Scene
Returns
Section titled “Returns”Promise<any>
Implementation of
Section titled “Implementation of”Addable.addToScene