Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Adding and Accessing my own assets (sounds, images, etc.)
-
How do I add and access my own assets for building a 2D game, rather than using the very nice collection of built in assets?
-
@quantumquark you can share files from Files, or Workflow app, etc. Then, you can use
ui.Image.named('full_path_to_file')
You can also use relative paths, but that often confuses people. The current working directory changes when you press "Play", so if you place pngs or jpegs in the same folder as the running script, you can just load the image name, without the full path.
-
@quantumquark If you import an image to the folder where your game script is (or any subfolder), then you should be able to add it as you would the built-in assets. Just tap the plus button and look under files (should be above emojis but may not show until you import an image from your camera roll).