omz:forum

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

    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 1
    • Posts 5
    • Best 1
    • Controversial 0
    • Groups 0

    SithMauls

    @SithMauls

    1
    Reputation
    344
    Profile views
    5
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    SithMauls Unfollow Follow

    Best posts made by SithMauls

    • RE: Viewing Definitions

      @dgelessus Thanks for being so thorough in your answer. I'd read somewhere that source code is often split between various languages and compiled differently, but your answer has cleared up a few things for me. That scene.py file is also interesting to look at; thanks for pointing me to it :)

      posted in Pythonista
      SithMauls
      SithMauls

    Latest posts made by SithMauls

    • RE: Viewing Definitions

      @enceladus Thank you! I was trying to create an enemy movement that spiralled toward the centre of the screen and I've finally cracked it with the help from the replies in this post! :)

      Much appreciated! I'm delighted!

      posted in Pythonista
      SithMauls
      SithMauls
    • RE: Viewing Definitions

      @dgelessus Thanks for being so thorough in your answer. I'd read somewhere that source code is often split between various languages and compiled differently, but your answer has cleared up a few things for me. That scene.py file is also interesting to look at; thanks for pointing me to it :)

      posted in Pythonista
      SithMauls
      SithMauls
    • RE: Viewing Definitions

      @enceladus Thanks for the in-depth reply! I quite like the custom_action implementation, I'm just playing around with it now and wondered if it was possible to add parameters to the custom actions. I can get a custom action to function if it takes no parameters, but I'm struggling with ones that do take parameters.

      As an example, I have a function which rotates one object around another by a specified amount of degrees:

      	def rotate_around(self, point, centre, angle):
      		p = point.position #point
      		c = centre.position #centre
      		a = ((angle)*(math.pi/180)) #angle
      			
      		x = math.cos(a)*(p.x-c.x)-math.sin(a)*(p.y-c.y)+c.x
      		y = math.sin(a)*(p.x-c.x)+math.cos(a)*(p.y-c.y)+c.y
      		point.position = (x,y)
      

      How would I go about translating this into a custom action so that it could be used in a sequence or group etc?

      Again, thanks for the help! :)

      posted in Pythonista
      SithMauls
      SithMauls
    • RE: Viewing Definitions

      Thanks for taking the time to reply. Sadly, I don't think I've worded myself very well so I'll try specifying a bit more carefully.

      In the Scene module, there are Action objects with methods such as "move_to" and "rotate_by", I'd like to be able to view the code that defines these built-in methods so I can get a better understanding of them.

      So I'm assuming there's code somewhere within the app under the Action class that includes a function definition beginning "def move_to(x, y[, duration, timing_mode])" and containing the code which is executed when this method is called.

      I might have my assumptions wrong, or this code might be inaccessible to view, so apologies if I'm asking a silly question. Viewing the definitions for built-in methods would just be quite convenient for me, as a learner, to better understand how things work.

      posted in Pythonista
      SithMauls
      SithMauls
    • Viewing Definitions

      I've been using Pythonista for about a week now; primarily as a learning tool while I'm on the go. With that in mind, my terminology might be a little off so I apologise if I sound like I have no idea what I'm talking about.

      Basically, I've been playing around with making little 2D games with the app and I want to delve into some of the functions a bit more. I was hoping to be able to see some of the definitions for functions so I can get a glimpse of how they perform. I'd also like to implement my own action functions similar to "move_to" and "rotate_by".

      Is it possible to view these definitions somewhere? Either within the app or online etc. I believe Visual Studio allows you to highlight a function call and right-click to view its definition but I'm struggling to find anything similar in Pythonista.

      Any help would be much appreciated! :)

      posted in Pythonista
      SithMauls
      SithMauls