omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. Cubbarooney104
    3. Topics

    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.


    • Profile
    • Following 0
    • Followers 0
    • Topics 11
    • Posts 67
    • Best 0
    • Controversial 0
    • Groups 0

    Topics created by Cubbarooney104

    • Cubbarooney104

      Sounds & Fonts
      Pythonista • • Cubbarooney104

      30
      0
      Votes
      30
      Posts
      24160
      Views

      mikael

      @jerovargas, ok, a version that streams a longer file instead of downloading it first.

      import objc_util objc_util.load_framework('AVFoundation') AVPlayer = objc_util.ObjCClass('AVPlayer') def play(url): audio_player = AVPlayer.playerWithURL_(objc_util.nsurl(url)) audio_player.play() return audio_player player = play('https://file-examples.com/wp-content/uploads/2017/11/file_example_MP3_2MG.mp3') input('Press enter to stop') player.pause()
    • Cubbarooney104

      Photos Module, PIL, and layer.image
      Pythonista • • Cubbarooney104

      3
      0
      Votes
      3
      Posts
      2643
      Views

      Cubbarooney104

      Thanks omz!

      By the way, this is why I love Python. It is so simple, yet is very adaptable.

      Cubbarooney

    • Cubbarooney104

      Keyboards
      Pythonista • • Cubbarooney104

      16
      0
      Votes
      16
      Posts
      9547
      Views

      omz

      @Rossburnett Do you happen to be running iOS 5?

    • Cubbarooney104

      "Goodbye"
      Pythonista • • Cubbarooney104

      2
      0
      Votes
      2
      Posts
      2008
      Views

      Dalorbi39

      We'll see you later, have fun, stay sane we need you here :)

    • Cubbarooney104

      Separate Files
      Pythonista • • Cubbarooney104

      7
      0
      Votes
      7
      Posts
      4527
      Views

      Cubbarooney104

      @PyLot
      Wow, thanks! that really helps keep things a bit more organized :)

      I owe ya' one.

      Cubbarooney

    • Cubbarooney104

      More Scene Help
      Pythonista • • Cubbarooney104

      8
      0
      Votes
      8
      Posts
      4856
      Views

      eliskan175

      Nice, I learned something new too! Didn't know xrange was better than range for iterating through loops. Apparently, the only time we should use range is when we actually need the list.

      Gotta love lurking other peoples threads haha

      Now for my contribution...

      @Cubbarooney - Hit tests are easier than they appear, depending on what you need them to do. If you look at some of my projects, you will see they all contain a hit test function (the best one imo is the one I'm using in my Space Shooter and RTS demo, which checks a single point to see if it's hitting a box). I use these functions because often times the object I'm checking to be hit isn't technically a Rect object, they are images. Either way it's identical to testing a rectangle.

      Hit testing circles is a bit trickier especially if you're like me and didn't pay much attention in geometry. Here's a few working examples of hit tests that I did: http://omz-software.com/pythonista/forums/discussion/138/crude-hittest#Item_2

    • Cubbarooney104

      Scene Help
      Pythonista • • Cubbarooney104

      6
      0
      Votes
      6
      Posts
      5168
      Views

      Cubbarooney104

      Thanks omz! I'll look over the code you provided!

      Also, I realized you can (using a rectangle) do "self.layer.image = 'name_of_image'" and then not set a background color for the rectangle. The image then takes the dimensions of the rectangle.

      I'll post again if I have any further trouble. Thanks again!

      Cubbarooney

    • Cubbarooney104

      How Random is randint()?
      Pythonista • • Cubbarooney104

      5
      0
      Votes
      5
      Posts
      3159
      Views

      Cubbarooney104

      83 and 1/3 hours.... That would be quite some time!

      And thanks for the tip on clear and print. I have another program that does a loop a lot, but it does print a bit. I'll see what I can cut. I assume sounds slow it down a bit too.

      And thanks for the additional research!

      Randint() is very solid!

      Cubbarooney

    • Cubbarooney104

      Idea for the forums
      Pythonista • • Cubbarooney104

      10
      0
      Votes
      10
      Posts
      5757
      Views

      Cubbarooney104

      Not sure why I never tried @omz and see what would happen.

      As far as learning by example goes, it helps to have written explanations (which is why I love pound sings).

      Cubbarooney

    • Cubbarooney104

      Canvas Paths
      Pythonista • • Cubbarooney104

      4
      0
      Votes
      4
      Posts
      2958
      Views

      Cubbarooney104

      Thank you omz!

      Makes sense now :)

      Cubbarooney

    • Cubbarooney104

      Variables in functions
      Pythonista • • Cubbarooney104

      8
      0
      Votes
      8
      Posts
      4727
      Views

      Cubbarooney104

      Lol, ok. So make it exist on the "outside" and then (when used in a defined function) tell the program to use the global variable.

      Thanks for all your help!
      Cubbarooney