How do I open a file using the FileSystem?

0 favourites
  • 3 posts
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • What i want to do is simple:

    1) open a specific folder (to select a file) -> "Documents/Myfolder/" & var1 (the name of a folder created for the specific game you're playing)

    2) select one of the files listed, which opens (it's an image)

    I've tried following the manual, but i can't get to grasp it..

  • It's not clear to me whether you mean you want to list files in your project, or with a picker - you can use a file picker to pick a file directly, or you can use a folder picker to select a folder and then use the 'List contents' action to list all the files in that folder.

    It's also not clear to me what you mean by opening the image - perhaps you mean opening in the default associated app, in which case you would use the 'Shell open' action, or show the image in your project, in which case you'd need to read binary data from the chosen file.

    Note that if you want to do something like access a folder within the user's Documents folder, you need to use the special picker tag "<documents>", and that only works in desktop exports (Windows/macOS/Linux), and the same goes for the 'Shell open' action.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It's not clear to me whether you mean you want to list files in your project, or with a picker - you can use a file picker to pick a file directly, or you can use a folder picker to select a folder and then use the 'List contents' action to list all the files in that folder.

    It's also not clear to me what you mean by opening the image - perhaps you mean opening in the default associated app, in which case you would use the 'Shell open' action, or show the image in your project, in which case you'd need to read binary data from the chosen file.

    Note that if you want to do something like access a folder within the user's Documents folder, you need to use the special picker tag "<documents>", and that only works in desktop exports (Windows/macOS/Linux), and the same goes for the 'Shell open' action.

    I want to pick a file directly - In NW it shows directly the windows folder, but with WV2 the process is more complex and i didn't get it, what i did is:

    -> (pressing button) show open file picker

    picker tag: "<documents>" & "GameName\" & var1

    other settings default

    This shows the a file picker, but it doesn't actually open the folder i specified, it just remembers it (if i navigate to it) the next time the picker is shown.

    Then i should use the "On picker x complete" and "shell open", but i'm totally lost with that..

    Sorry if my question may be silly, I appreciate you taking some time to answer me!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)