• mikeno

    Super, thank you

    posted in Pythonista read more
  • mikeno

    Thx cvp but I don’t know how to download a module into Pythonista

    posted in Pythonista read more
  • mikeno

    Whao, I’m impressed, thank you!
    But I don’t understand why it doesn’t work in my last example

    posted in Pythonista read more
  • mikeno

    My last issue is that the drawing doesn’t refresh even when I call explicitly drawTest() as you can see in the example below:

    
    import ui
    
    class my(ui.View):
        
        def __init__(self, *args, **kwargs):
            self.factor = .5
    
        def draw(self):
            print('draw()')
            self.drawTest()
    
        def drawTest(self):
            print('drawTest()')
            print('%.1f' % (self.factor))
            w,h = ui.get_screen_size()
            path1 = ui.Path()
            path1.line_width = 3
            ui.set_color('red')
            path1.move_to(100*self.factor,100*self.factor)
            path1.line_to(200*self.factor,100*self.factor)
            path1.line_to(100*self.factor,200*self.factor)
            path1.close()
            path1.fill()
            path2 = ui.Path()#.rect(0,0,w,h)
            path2.line_width = 3
            ui.set_color('blue')
            path2.move_to(300*self.factor,100*self.factor)
            path2.line_to(400*self.factor,100*self.factor)
            path2.line_to(300*self.factor,200*self.factor)
            path2.close()
            path2.fill()
            
        def touch_began(self, touch):
            print('touch_began()')
            self.factor += .5
            self.drawTest()
            
        def will_close(self):
            print('will_close()')
            
    v = my()
    v.present('fullscreen',hide_title_bar=True)
    
    

    It redraws only when I turn the iPad, could you please tell me how I can force the refresh with the right zoom factor?

    posted in Pythonista read more
  • mikeno

    Thx to both of you, concerning the gestures, it seems to be a little bit complicated but I will try

    posted in Pythonista read more
  • mikeno

    ... and then, I need to redraw in order to see the polygons in a different zoom factor. As I wrote, I already tried with ui but I stoped because I could not redraw, that’s why I tried with scene

    posted in Pythonista read more
  • mikeno

    Yes thx it works but it doesn’t with several polygons

    posted in Pythonista read more
  • mikeno

    I just want to draw a filled polygone following numerous coordinates, I already managed to do it with ui and canvas but only scene gives me the possibility to use full screen

    posted in Pythonista read more
  • mikeno

    Hi Mikael, thx for replying but is there a way to avoid this?

    posted in Pythonista read more
  • mikeno

    Hi, looking back to this example, I tried to play a bit and discovered what seems to be an issue:

    
    from scene import *
    import time
    class MyScene (Scene):
        def setup(self):
            sx, sy = self.size.w, self.size.h
            self.red = ShapeNode(ui.Path.rect(0,0,sx,sy),parent=self,fill_color='red',position=(0,0),anchor_point=(0,0))
            path = ui.Path()
            path.line_width = 3
            path.move_to(0,0)
            path.line_to(100,0)
            #path.line_to(0,100) # Uncommenting this line modifies the drawing of both previous lines
            self.cyan = ShapeNode(path,parent=self.red,stroke_color='white',position=(0,0),anchor_point=(0,0))
    if __name__ == '__main__':
        run(MyScene())
    
    

    Removing the comment modifies how both previous lines are drawn!
    I tried to understand but it is still unclear for me

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!