lil-gui/lil-gui.umd.js
/**
		 * Returns an object mapping controller names to values. The object can be passed to `gui.load()` to
		 * recall these values.
		 * @example
		 * {
		 * 	controllers: {
		 * 		prop1: 1,
		 * 		prop2: 'value',
		 * 		...
		 * 	},
		 * 	folders: {
		 * 		folderName1: { controllers, folders },
		 * 		folderName2: { controllers, folders }
		 * 		...
		 * 	}
		 * }
		 *
		 * @param {boolean} recursive Pass false to exclude folders descending from this GUI.
		 * @returns {object}
		 */
Returns an object mapping controller names to values. The object can be passed to `gui.load()` to
recall these values.

@param {boolean} recursive Pass false to exclude folders descending from this GUI.
@returns {object}
Returns an object mapping controller names to values . The object can be passed to ` gui . load () ` to recall these values . @param { boolean } recursive Pass false to exclude folders descending from this GUI . @returns { object }
save( recursive = true ) {
			const obj = {
				controllers: {},
				folders: {}
			};
			this.controllers.forEach( c => {
				if ( c instanceof FunctionController ) return;
				if ( c._name in obj.controllers ) {
					throw new Error( `Cannot save GUI with duplicate property "${c._name}"` );
				}
				obj.controllers[ c._name ] = c.save();
			} );
			if ( recursive ) {
				this.folders.forEach( f => {
					if ( f._title in obj.folders ) {
						throw new Error( `Cannot save GUI with duplicate folder "${f._title}"` );
					}
					obj.folders[ f._title ] = f.save();
				} );
			}
			return obj;
		}
save ( recursive = true ) { const obj = { controllers : { } , folders : { } } ; this . controllers . forEach ( c => { if ( c instanceof FunctionController ) return ; if ( c . _name in obj . controllers ) { throw new Error ( ` ${ c . _name } ` ) ; } obj . controllers [ c . _name ] = c . save ( ) ; } ) ; if ( recursive ) { this . folders . forEach ( f => { if ( f . _title in obj . folders ) { throw new Error ( ` ${ f . _title } ` ) ; } obj . folders [ f . _title ] = f . save ( ) ; } ) ; } return obj ; }
Returns an object mapping controller names to values.
Returns an object mapping controller names to values .