omz:forum

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

    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 1
    • Followers 0
    • Topics 2
    • Posts 3
    • Best 1
    • Controversial 0
    • Groups 0

    __mw__6m

    @__mw__6m

    1
    Reputation
    542
    Profile views
    3
    Posts
    0
    Followers
    1
    Following
    Joined Last Online

    __mw__6m Unfollow Follow

    Best posts made by __mw__6m

    • [Bug] Node.frame and Node.bbox are 1 pixel too wide and too high

      Hi everybody !

      I noticed that when you take the width and height of a node, they are 1 pixel too wide and 1 pixel too high :

      class MyScene (Scene):
      	def setup(self):
      		s=SpriteNode('pzl:BallBlue')
      		self.add_child(s)
      		s.position = 200,345
      		
      		s.size = 15,15
      		
      		print s.bbox
      		print s.frame
      	
      

      It gives :

      (192.50, 337.50, 16.00, 16.00)
      (192.50, 337.50, 16.00, 16.00)
      

      It does really matter when you deal with this situation like I did :
      You have a parent Node that has a .scale over 100.
      You have a child SpriteNode with a size=(1.0,1.0).

      You try to know if a ouch happened in the child's frame/bbox :
      The given bbox is (x,y,2.0,2.0) instead of (x,y,1.0,1.0).
      That means your touch area is 4 time larger that it should be !

      class MyScene (Scene):
      	def setup(self):
      		self.scale = 100
      		
      		s=SpriteNode('pzl:BallBlue')
      		self.add_child(s)
      		s.position = 2,2
      		
      		s.size = 1,1
      		
      		print s.bbox
      		print s.frame
      	
      

      It gives :

      (1.50, 1.50, 2.0, 2.0)
      (1.50, 1.50, 2.0, 2.0)
      

      I bypassed the bug by storing the bbox and fixing it's height and width with my SpriteNode.size ones. But it would be nice to fix it in the next release :-)

      posted in Pythonista
      __mw__6m
      __mw__6m

    Latest posts made by __mw__6m

    • List node's Actions

      Hello !
      I've not been able to find a solution to this problem :

      How can I list the actions (or action keys) beiing played by on a Node ?

      The only solution I see is maintaining this list myself anytime I run a new action.

      Cheers,

      posted in Pythonista
      __mw__6m
      __mw__6m
    • [Bug] Node.frame and Node.bbox are 1 pixel too wide and too high

      Hi everybody !

      I noticed that when you take the width and height of a node, they are 1 pixel too wide and 1 pixel too high :

      class MyScene (Scene):
      	def setup(self):
      		s=SpriteNode('pzl:BallBlue')
      		self.add_child(s)
      		s.position = 200,345
      		
      		s.size = 15,15
      		
      		print s.bbox
      		print s.frame
      	
      

      It gives :

      (192.50, 337.50, 16.00, 16.00)
      (192.50, 337.50, 16.00, 16.00)
      

      It does really matter when you deal with this situation like I did :
      You have a parent Node that has a .scale over 100.
      You have a child SpriteNode with a size=(1.0,1.0).

      You try to know if a ouch happened in the child's frame/bbox :
      The given bbox is (x,y,2.0,2.0) instead of (x,y,1.0,1.0).
      That means your touch area is 4 time larger that it should be !

      class MyScene (Scene):
      	def setup(self):
      		self.scale = 100
      		
      		s=SpriteNode('pzl:BallBlue')
      		self.add_child(s)
      		s.position = 2,2
      		
      		s.size = 1,1
      		
      		print s.bbox
      		print s.frame
      	
      

      It gives :

      (1.50, 1.50, 2.0, 2.0)
      (1.50, 1.50, 2.0, 2.0)
      

      I bypassed the bug by storing the bbox and fixing it's height and width with my SpriteNode.size ones. But it would be nice to fix it in the next release :-)

      posted in Pythonista
      __mw__6m
      __mw__6m