• heyguy4

    Okay, so I'm trying to use the canvas to draw a trapezoid. Here's my code. For some reason it just creates an empty box.

    # coding: utf-8
    import canvas
    b = 10
    canvas.set_size(500, 500 + b)
    canvas.draw_rect(0, 0 + b, 500, 500)
    canvas.set_fill_color(1, 0.1, 0.1)
    canvas.set_stroke_color(1, 0, 0)
    canvas.set_line_width(4)
    canvas.begin_path()
    canvas.add_line(150, 100 + b)
    canvas.add_line(350, 100 + b)
    canvas.add_line(400, 200 + b)
    canvas.add_line(100, 200 + b)
    canvas.add_line(150, 100 + b)
    canvas.draw_path()
    canvas.fill_path()
    canvas.close_path()

    posted in Pythonista read more
  • heyguy4

    I did what you said but I'm still getting the "Image Not Found" Error

    posted in Pythonista read more
  • heyguy4

    It's not in a sub folder. I have no idea why it's not working.

    posted in Pythonista read more
  • heyguy4

    @omz Does the folder have to have the same name as the program?

    posted in Pythonista read more
  • heyguy4

    Yes it is

    posted in Pythonista read more
  • heyguy4

    That solves the issue with the blue gem not appearing, but if I use one of my own images that I imported into the folder

    self.spriteName.texture = Texture('IMG_0469.JPG')
    

    returns a "Image not found" error and

    self.spriteName.texture = Texture(ui.Image.named('IMG_0469.JPG'))
    

    returns a "Could not load image" error

    posted in Pythonista read more
  • heyguy4

    Okay now there's no error, but I can't see the sprite when the code compiles.
    Here's my setup method

            def setup(self):
                    self.background_color = 'green'
    
                    self.spriteName = SpriteNode()
    
    
                    self.spriteName.anchor_point = (5,5)
                    self.spriteName.position = (50, 50)
    
                    self.spriteName.texture = Texture('plc:Gem_Blue')
    

    posted in Pythonista read more
  • heyguy4

    Now it says "global name 'scene' is not defined"

    posted in Pythonista read more
  • heyguy4

    @omz Whenever I try that, I get an error that says "Expected a texture object".

    posted in Pythonista read more
  • heyguy4

    I have a sprite called spriteName. Whenever I type something like.

    self.spriteName.texture = ('plc:Gem_Blue')
    

    or import my own image into my own folder called Textures and use

    self.spriteName.texture = ('Textures/IMG_0469.JPG')
    

    They both result in the error "TypeError: Expected a Texture Object"
    I don't know what I'm doing wrong.

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!