omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. echen
    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 3
    • Posts 6
    • Best 2
    • Controversial 0
    • Groups 0

    Topics created by echen

    • echen

      Animation of complex objects
      Pythonista • • echen

      4
      1
      Votes
      4
      Posts
      2768
      Views

      brumm

      here are other examples.

      # coding: utf-8 from scene import * import ui class MyScene(Scene): def setup(self): startx = 20 starty = 20 length = 100 width = 200 self.rect1 = Rect(startx, starty, width, length) self.rect2 = Rect(startx*2, starty, width/2, length/2) self.elli1 = Rect(startx*2, starty*2, 10, 10) self.elli2 = Rect(startx*8, starty*2, 10, 10) self.rect1_layer = Layer(self.rect1) self.rect1_layer.background = Color(.5,.5,.5) #grey self.add_layer(self.rect1_layer) self.rect2_layer = Layer(self.rect2) self.rect2_layer.background = Color(0,1,0) #green self.add_layer(self.rect2_layer) def draw(self): background(0,0,1) fill(0,1,1) #cyan rect(*self.rect1) self.rect2_layer.update(self.dt) self.rect2_layer.draw() fill(1,0,0) #red ellipse(*self.elli1) ellipse(*self.elli2) self.rect1_layer.update(self.dt) self.rect1_layer.draw() def touch_began(self, touch): self.rect1_layer.animate('alpha', 0.0, duration=1.0, autoreverse=False) # grey => cyan self.rect2_layer.animate('rotation', 180.0, duration=2.0, autoreverse=False) self.elli1 = Rect(touch.location.x, touch.location.y, 10, 10) # Pythonista docu: Animatable attributes are frame, scale_x, scale_y, rotation, background, stroke, stroke_weight, tint and alpha. class SceneViewer(ui.View): def __init__(self, in_scene): self.present('fullscreen') self.scene_view = SceneView(frame=self.bounds) self.scene_view.scene = in_scene self.add_subview(self.scene_view) SceneViewer(MyScene())
    • echen

      ui.webview and authentication
      Pythonista • • echen

      5
      0
      Votes
      5
      Posts
      3529
      Views

      echen

      Thanks for the replies, both suggestions worked.

    • echen

      textfield validation example
      Pythonista • • echen

      4
      0
      Votes
      4
      Posts
      3567
      Views

      echen

      thanks for the replies, I think I understood it better now. One more question, how I keep the input focus to a field if it fails a validation, but still allow the user to cancel or click the X button to close the view?