• Excellent :-)
    Many thanks, that worked.

    Re Peter

  • Yes, the location of the .pyui file would be helpful.

  • backgroundSwap.py https://gist.github.com/cclauss/7132028

    Create three background images in scene.setup() then in scene.draw() use the x coordinate of the user's drag location to determine which background image to display. The grey dot represents foreground drawing that takes place on top of one of three different backgrounds. This method could be used for example to make a multilevel game where the graphics for each level were drawn up front and stored in PIL images. The foreground would then be drawn on top of the background of the current level in the scene.draw() method.

  • I forgot to mention that you can also use python's <b>lambda</b> to accomplish this.<pre>from scene import *

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

    def draw(self): background(0, 0, 0) #test(100,100) self.a()

    run(MyScene())

    def test(x,y):
    rect(x,y,20,20)</pre>

  • How do you put formatted code in the forum?

    Use HTML < pre > and < /pre > tags.

  • Thanks,

    That put a lot in place for me :-)
    I had messed around with the load_pil_image but not in conjugation with the init of the image.
    I come from Codea where things are a bit more straight forward and direct understandable.
    A task like this would be. Define the image - write to context - end context, and when you want to use the image, it is just a call to the name, because it allready exist in memory.

    Also I took a mental note on the global issue and use self instead.

    Re Peter

Internal error.

Oops! Looks like something went wrong!