omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. mmontague

    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 6
    • Posts 25
    • Best 0
    • Controversial 0
    • Groups 0

    mmontague

    @mmontague

    0
    Reputation
    919
    Profile views
    25
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    mmontague Unfollow Follow

    Latest posts made by mmontague

    • RE: Real time NumPy (and ghosts!)

      This cool.
      But I don't understand the purpose of the first line in update_positions().

      self.vels *= 0.8 ** self.dt 
      

      What is 0.8, and why is it raised to the power of time elapsed?

      posted in Pythonista
      mmontague
      mmontague
    • Can use PIL image for SpriteNode.texture?

      Hi all,

      In the previous beta, I was able to set the SpriteNode.texture using the image identifier returned from load_pil_image(). E.g. when initializing the SpriteNode:

      my_img = Image.open('my_image_file.png')  
      my_sprite = SpriteNode(texture=load_pil_image(my_img), position=(0,0))
      

      And when I set SpriteNode.texture directly, I found I needed to use a Texture object but using load_pil_image() stilll worked, e.g.:

      my_sprite.texture = Texture(load_pil_image(my_img))
      

      However, now (with the new beta) I find that neither of the above works. If I attempt either of the above Pythonista just closes. It seems that I need to first convert my image to a ui.Image before setting the SpriteNode.texture.

      The documentation for scene.Texture does state that "Textures can be initialized using either the name of a built-in image (a string), or a ui.Image object." No mention here of supporting PIL images. However, as I said I could do this previously... and so I'm wondering if truly the SpriteNode.texture is only meant to be used with ui.Image (or built-in images), and if all PIL images will then need to be converted to ui.Image in order to be used with a SpriteNode.

      Or if I'm doing something wrong.

      posted in Pythonista
      mmontague
      mmontague
    • RE: Help! my pythonista 1.6 Beta expired

      Yeah thanks omz for getting that up there so fast. And in the nick of time, whew. Was not looking forward to the prospect of a day without Pythonista!

      posted in Pythonista
      mmontague
      mmontague
    • RE: Bug list for beta release 160037

      It's there now.
      Woke up to find the 037 beta waiting in TestFlight!

      posted in Pythonista
      mmontague
      mmontague
    • RE: Help! my pythonista 1.6 Beta expired

      Oops, looks like I missed the conversation on this from a couple of days ago. Sounds like another beta is in the works. (Opening up TestFlight must have had nothing to do with it, just a coincidence...)

      posted in Pythonista
      mmontague
      mmontague
    • Help! my pythonista 1.6 Beta expired

      And I can't open the app.
      It happened right after I went into TestFlight to check the expiration of the Beta.

      posted in Pythonista
      mmontague
      mmontague
    • RE: Recreate Touch Methods for Nodes

      I was about to post this same question. It seems like all touches have to be handled at the Scene level in 1.6.

      posted in Pythonista
      mmontague
      mmontague
    • RE: Displaying portion of image to screen, scroll to rest of it.

      @ccc That is helpful information, thanks.

      OK, I didn't even know that ui.ScrollView existed. That is going to come in handy!

      m

      posted in Pythonista
      mmontague
      mmontague
    • Displaying portion of image to screen, scroll to rest of it.

      I have a question about the right way to go about something, in general terms...

      I have a large image (I can scale it to the width of the screen, but it will still be about twice the height of the screen). I would like to show just a part of the image that will fit on the screen, and then be able to scroll through the image to view different parts of it (using buttons or whatever).

      But I am unsure of the best way to handle the displaying of the larger-than-screen-size image. I have it working now by creating a layer that is the width of the screen but twice the height of the screen, and then setting this Layer's image property to my image:

        im = Image.open("bgnd.png").convert('RGBA') 
        w = int(self.bounds.w) # width of screen
        h = int(im.size[1] * self.bounds.w / im.size[0]) # scale height keep aspect ratio
        im = im.resize((w,h)) # scale image to fit screen width; image height > screen height
        self.im_layer=Layer(Rect(0,0,w,h)) # this layer is larger than screen!
        self.root_layer.add_layer(self.im_layer)
        self.im_layer.image = load_pil_image(im)
      

      This seems to work, but it feels wrong...

      Is setting a Layer to be larger than the screen size OK to do? What does Pythonista do with the portion of the image that is off screen? Could this be problematic if the image were larger, say 10x the height of the screen? How should this issue -- scrolling through a image larger than the screen -- be handled in applications and on the pythonista platform in particular?

      posted in Pythonista
      mmontague
      mmontague
    • RE: Multi-frame GIFs to clipboard or photos

      It works! Awesome, thanks!

      posted in Pythonista
      mmontague
      mmontague