Difference between revisions of "Mediamanager:getFile"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
Line 7: Line 7:
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
 
(string) = mediamanager:getFile()
 
(string) = mediamanager:getFile()
</source>
+
</syntaxhighlight>
  
 
=== Return values ===
 
=== Return values ===
Line 23: Line 23:
 
mediamanager:addEventListener(Event.MEDIA_RECEIVE, mediareceive)
 
mediamanager:addEventListener(Event.MEDIA_RECEIVE, mediareceive)
 
end
 
end
</source>
+
</syntaxhighlight>
  
 
{{Media}}
 
{{Media}}

Latest revision as of 14:30, 13 July 2023

Available since: Gideros 2016.1
Class: Media

Description

Allows user to select a file from system file (tested on windows 10).

(string) = mediamanager:getFile()

Return values

Returns (string) path to the file

Example

Browse your system for a file of any type

function AnimationScene:browse()
	local function mediareceive(e)
		print(e.path)
		mediamanager:removeEventListener(Event.MEDIA_RECEIVE, mediareceive)
	end
	mediamanager:getFile("*", lfs.currentdir())
	mediamanager:addEventListener(Event.MEDIA_RECEIVE, mediareceive)
end