omz:forum

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

    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 39
    • Best 14
    • Controversial 0
    • Groups 0

    Oscar

    @Oscar

    17
    Reputation
    1355
    Profile views
    39
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Oscar Unfollow Follow

    Best posts made by Oscar

    • RE: Wish list for next release

      A unary minus for the Vector2 class would have been nice:

      >>> import scene
      >>> v = scene.Vector2(1, 2)
      >>> v * -1
      Vector2(-1.00, -2.00)
      >>> -v
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
      TypeError: bad operand type for unary -
      

      And the next beta build linked against the GameController network. We can test if it solves the problem by using the objc module.

      posted in Pythonista
      Oscar
      Oscar
    • RE: TableViewCell.detail_text_label

      I was wondering the exact same thing as @Omega0 did two years ago. Since the documentation has not yet been updated it's great to have this forum and that it is easy to search.

      posted in Pythonista
      Oscar
      Oscar
    • RE: Disable on screen printing in Scene/SceneView

      Not only is Pythonista amazing, the level of support is equally crazy! Thank you @omz.

      ObjC is nifty for all sorts of things.

      posted in Pythonista
      Oscar
      Oscar
    • RE: Rotating Sprites to Face Movement Direction in Scene

      @AtomBombed If you post code from your failed attempt I am sure someone will help you out. Without the specifics of the situation I can only give you the hint that math.atan2() is a very handy function.

      posted in Pythonista
      Oscar
      Oscar
    • RE: How to draw a circle segment (pie) in Scene?

      I think that right now the way to do it is using a PathNode. The old way of doing explicit drawing is not very efficient.

      Edit: I meant ShapeNode when I wrote PathNode...

      posted in Pythonista
      Oscar
      Oscar
    • RE: Getting the parent of a dynamically method as a function

      @Phuket2 Did you see my reply above? Isn't that exactly what you are asking for? Why not? You have the reference to the button in the method without giving it as an argument every time you call it.

      posted in Pythonista
      Oscar
      Oscar
    • RE: Getting the parent of a dynamically method as a function

      @Phuket2, I don't know why you want to do this, I'm not sure I even know what you want to do.

      Perhaps something like this?

      import ui
      
      def extra_function(self, message):
        print 'My class: ', self.__class__
        print message
      
      b = ui.Button()
      b.extra_function = lambda *a, **kw: extra_function(b, *a, **kw)
      
      b.extra_function('The message')
      
      posted in Pythonista
      Oscar
      Oscar
    • RE: MFi Game Controller Support

      @Cethric, I am pretty certain that you do not have to handle controller discovery in the app unless you want to.

      https://developer.apple.com/library/ios/documentation/ServicesDiscovery/Conceptual/GameControllerPG/Introduction/Introduction.html
      "Although support for pairing is normally provided by the operating system (typically in the Preferences or Settings, you can use the Game Controller framework to pair devices inside your game. "

      https://developer.apple.com/library/ios/documentation/ServicesDiscovery/Conceptual/GameControllerPG/DiscoveringControllers/DiscoveringControllers.html#//apple_ref/doc/uid/TP40013276-CH2-SW1
      "Normally, discovery occurs outside your game—that is, a player usually pairs the controller before launching your game. However, you can let a player discover new controllers from within your game."

      Still I tried using startWirelessControllerDiscoveryWithCompletionHandler, but that didn't make a difference. I might have made a mistake though, because the completion handler block was never called, not even after a call to stopWirelessControllerDiscovery.

      posted in Pythonista
      Oscar
      Oscar
    • MFi Game Controller Support

      I bought a SteelSeries Stratus XL game controller for my new Apple TV today. I thought it would be fun to connect to it with Pythonista, but I ran into problems very quickly.

      The whole thing seemed pretty straight forward. The objc_util package is fantastic, it is the first time I read the documentation. The GCController class should very easy to work with, especially since it should work well with only polling (I want to stay away from callbacks, handlers and blocks, at least at first): https://developer.apple.com/library/ios/documentation/GameController/Reference/GameController_RefColl/index.html

      So here we go!

      from objc_util import *
      
      GCController = ObjCClass('GCController')
      controllers = GCController.controllers()
      print controllers
      

      I expected to see an empty list when the controller was turned off, and a list with one element when the controller was on. Instead I got an error:

      ValueError: no Objective-C class named 'GCController' found

      I checked what classes are available. (This takes some time if anyone plans to run this code.)

      from objc_util import *
      
      classes = ObjCClass.get_names()
      print classes
      

      There are no classes starting with GC in the list. It would have been between 'FontSizeSliderCell' and 'GEOABExperimentAssignment'. I assume that is due to the fact that the "Game Controller Framework" is not linked into the Pythonista binary.

      What a pity! I was kind of looking forward to building something to play with proper buttons. That would have been great fun.

      So I assume we cannot use a controller unless @omz decides to add the "Game Controller Framework" to Pythonista. Or am I missing something?

      posted in Pythonista
      Oscar
      Oscar
    • RE: Scene transitions

      I just made my first animated gif!

      This is what the scene transitions in action looks like. The gif is just 10 fps, but on the device it is of course in full frame rate:

      alt text

      So that is five different Scenes put together.

      The point of the experiment is to stitch together normal Scenes into a larger app. Right now the Scenes does not have to know anything about the SceneSwitcher until they use it to start the next Scene.

      posted in Pythonista
      Oscar
      Oscar

    Latest posts made by Oscar

    • RE: Help with intersetion between line and rect

      A quick google search found me this:
      Detection between a circle and a line

      Should be a good start.

      posted in Pythonista
      Oscar
      Oscar
    • RE: Git or Gist workflow for Pythonista

      @ccc It looks nice. Just checking to see that I've understood this... It is a way to check out the files from a git repo into Pythonista. And Working Copy itself can keep the files in sync between iOS devices. But getting changes of the files out of Pythonista is not covered by this solution. Do you copy-paste the changes into Working Copy manually?

      How do you use it yourself?

      posted in Pythonista
      Oscar
      Oscar
    • OpenGL

      I was wondering about the current state of OpenGL/GLES/GLKit support for Pythonista (3). Between numpy and objc_util I guess the possibilities are there.

      posted in Pythonista
      Oscar
      Oscar
    • RE: Sync files with Dropbox

      @bennr01 Thanks for the clarification and the links. It is unfortunate that syncing between your own devices can't be built in because of this.

      posted in Pythonista
      Oscar
      Oscar
    • RE: Sync files with Dropbox

      I'm not sure that a built in Dropbox sync feature would not be allowed by Apple. If Editorial already syncs scripts it seems ok. Apple is trying to prevent people from building app stores in apps as well as trying to protect people from running potentially bad programs.

      I understand why the "Open in.." feature was not allowed by Apple considering their policies, but that is a different thing.

      Syncing your own Python programs between your devices with Dropbox might not be a problem.

      posted in Pythonista
      Oscar
      Oscar
    • RE: TableViewCell.detail_text_label

      I was wondering the exact same thing as @Omega0 did two years ago. Since the documentation has not yet been updated it's great to have this forum and that it is easy to search.

      posted in Pythonista
      Oscar
      Oscar
    • RE: Disable on screen printing in Scene/SceneView

      Not only is Pythonista amazing, the level of support is equally crazy! Thank you @omz.

      ObjC is nifty for all sorts of things.

      posted in Pythonista
      Oscar
      Oscar
    • Disable on screen printing in Scene/SceneView

      I've looked but I can't find anything about this. Does anyone know if there is a way to disable the on screen printing in a Scene/SceneView?

      I'm referring to this: For debugging purposes, a SceneView will show standard output and exceptions in a “status line” at the bottom, so you can use print statements during development, even if your scene covers the whole screen.

      (Actually this is only documented in SceneView, even though the feature is available when using Scene.run() to show a Scene. )

      Sometimes printing stuff when running a script is useful, even when you don't want to see it directly on screen.

      posted in Pythonista
      Oscar
      Oscar
    • RE: v2.0 vs v2.1 : hard crash using "reserved" var names ?

      I don't know if it is related, but I am encountering a crash with a very similar piece of code, but not for code completion. This crashes when it is run:

      # coding: utf-8
      
      from scene import *
      import sound
      import random
      import math
      A = Action
      
      class MyScene (Scene):
          def setup(self):
                      #Does not crash 
      	    SpriteNode('emj:Airplane', position=self.size/2, parent=self)
                      # Will crash
      	    SpriteNode('iow:alert_256', position=self.size/2, parent=self)
      
      if __name__ == '__main__':
          run(MyScene(), show_fps=False)
      

      It's always crashing for me on Python 2.1, but not on Python 3.0. I assumed it had to do with some of the built-in image collections somehow.

      posted in Pythonista
      Oscar
      Oscar
    • RE: Python 3.x Progress Update

      On the donation/financial contribution topic. I can understand that @omz feels uncomfortable taking donations, this brings notions of charity. But me and many other are more than willing to contribute financially to the apps, to show appreciation for this wonderful tool and to help with/speed up future development. If there would be an anti-sale day for the new Python 3 version with a higher price (5x?) I would buy it that day.

      posted in Pythonista
      Oscar
      Oscar