omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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.


    Where to find or add images, sounds, etc.?

    Pythonista
    5
    5
    3733
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Des
      Des last edited by

      e.g. Cascade.py refers to images "Green_Apple" and sounds like "Coin_3". and Where are these located? Where will I find a list of all available images and sounds? And what is the recommended way & location to add my own images or sounds?

      Thanks!

      1 Reply Last reply Reply Quote 0
      • dgelessus
        dgelessus last edited by

        This thread may be helpful: http://omz-forums.appspot.com/pythonista/post/5910564375101440

        1 Reply Last reply Reply Quote 0
        • kaelin
          kaelin last edited by

          The referenced thread doesn't explain where / how to add your own images and sounds... I've come looking for the same thing. Do they simply go in the Documents folder on iOS 8? What image format is preferred?

          1 Reply Last reply Reply Quote 0
          • ccc
            ccc last edited by

            The warp_speed.py example at http://omz-forums.appspot.com/pythonista/post/5782227161972736 shows how to pull .mp3 and .caf sounds directly off the web but you can also read them from the local directory. For a more complicated example see Cloud_Jump2.py at https://github.com/Pythonista-Tools/Pythonista-Tools/blob/master/Games.md

            You can also look at the Sounds and Graphics directories of https://github.com/Pythonista-Tools/Pythonista-Tools photo_text.py shows how you can read in any image from the iOS Camera Roll.

            1 Reply Last reply Reply Quote 0
            • JonB
              JonB last edited by

              You can place them wherever you want, but a few of the functions seem to work best with absolute paths, so use os.path.abspath.

              I'm not sure if there is an official list of supported file types. For sounds, various favors of wav, mp3, and caf are known to work. One would imagine AAC, and other appleish formats might work.
              For images, I think you can use whatever PIL supports.... Png, jpg, for sure, probably gif, bmp, etc.

              Depending on what you are doing, you may require special handling, see for example
              https://omz-forums.appspot.com/pythonista/post/5271475556712448

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Powered by NodeBB Forums | Contributors