• macnfly

    Excellent :-)
    Many thanks, that worked.

    Re Peter

    posted in Pythonista read more
  • macnfly

    Hi,
    I have putting this out way to long, and it has annoyed me for some time.
    I want to hide the white cross when I run my coded flight sim panels on full screen.
    The iPad general information bar would be nice to hide as well, but that is not an option from what I read.

    But the Cross..... Is that possible in any way ?

    Re Peter

    posted in Pythonista read more
  • macnfly

    Oops, Sorry should have mentioned that it is the scene module with the setup and draw loop.

    My program has this in the running section "run(MyScene(), LANDSCAPE)"

    Re Peter

    posted in Pythonista read more
  • macnfly

    Hi, The export function to xcode is not working at the moment. Will it be back in the next update ?

    In the meantime. Is there a workflow to follow to manually get a script with images and txt files from Pythonista to the newest version of xcode ? Maybe downgrade xcode to an earlier version ?

    Appreciate a little help

    Best regards Peter

    Edit: Sorry for posting this in the wrong forum section at first (Markdown forum)

    posted in Pythonista read more
  • macnfly

    Hi,
    The export function to xcode is not working at the moment.
    Will it be back in the next update ?

    In the meantime.
    Is there a workflow to follow to manually get a script with images and txt files from Pythonista to the newest version of xcode ?
    Maybe downgrade xcode to an earlier version ?

    Appreciate a little help

    Best regards Peter

    posted in Editorial read more
  • macnfly

    Are there any avialable with the Pythonista modules able to write a screen dump to an image during run time ?

    posted in Pythonista read more
  • macnfly

    To clarify why I wants to take a screenshot or draw into a context, please consider the following code

    
    from scene import *
    from PIL import Image, ImageDraw
    
    class MyScene (Scene):
        def setup(self):
            img = Image.new("RGBA", (300,300))
            draw = ImageDraw.Draw(img)
            draw.ellipse((0,0,200,200),fill=(255,255,255,255))
            del draw
            self.imageName = load_pil_image(img)
        def draw(self):
            background(0.09,0.09,0.102)
            image(self.imageName,200,300,300,300)
            fill(1,1,1,1)
            no_stroke()
            ellipse(500,400,200,200)
    run(MyScene(), LANDSCAPE)
    
    

    There is a clearly visible difference between the two circles.
    What I am aiming for is to predefine a number of pictures in Setup and then use those in Draw.
    The pictures are complicated and I think it would be to expencive to FPS to draw all the elements they contain (text, multiple lines, circles, gradients and so on) in every Draw loop.
    An option would be to make the images by forehand but since the user will need to change details, this is not an option.
    So I was thinking on setting up the whole 1024x768 backgrund picture in Setup and every time the user specifies changes.

    Hope this clarifies a little ccc as a reply to you pm.

    Thanks Peter

    posted in Pythonista read more
  • macnfly

    The thing I was looking for was a way to build a picture in the Scene Setup and then use this as a regular image later on in draw.
    I know this can be done with a PIL image directly, but the drawing of especially circles and arcs has no anti aliasing and therefore looks ugly.

    So my idea was to build the whole image from drawing elements and then screen shot it to an image. The app would blink at startup, I think, but that is not a problem.
    Building the image before run is not an option since there will be changes from time to time when the app is launched.

    Re Peter

    posted in Pythonista read more
  • macnfly

    I have this code but it seems impossible for me to save the function to a variable with parameters and call it later on.
    <pre>
    from scene import *

    class MyScene (Scene):
    def setup(self):
    self.a = test(200,200)

    def draw(self):
        background(0, 0, 0)
        test(100,100)
        #how do I call self.a with its parameters
    

    run(MyScene())

    def test(x,y):
    rect(x,y,20,20)

    </pre>

    Test(100,100) works fine !
    Re Peter

    posted in Pythonista read more
  • macnfly

    Ohhh thanks, just what I was after :-)
    Python has all these smart bits, but sometimes hard to find if you do not know what to search for. Like this one, the name does not tell exactly.

    Re Peter

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!