omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. heyguy4

    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 4
    • Posts 14
    • Best 0
    • Controversial 0
    • Groups 0

    heyguy4

    @heyguy4

    0
    Reputation
    707
    Profile views
    14
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    heyguy4 Unfollow Follow

    Latest posts made by heyguy4

    • Can't fill path

      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
      heyguy4
      heyguy4
    • RE: How do I add textures to sprites?

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

      posted in Pythonista
      heyguy4
      heyguy4
    • RE: How do I add textures to sprites?

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

      posted in Pythonista
      heyguy4
      heyguy4
    • RE: How do I add textures to sprites?

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

      posted in Pythonista
      heyguy4
      heyguy4
    • RE: How do I add textures to sprites?

      Yes it is

      posted in Pythonista
      heyguy4
      heyguy4
    • RE: How do I add textures to sprites?

      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
      heyguy4
      heyguy4
    • RE: How do I add textures to sprites?

      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
      heyguy4
      heyguy4
    • RE: How do I add textures to sprites?

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

      posted in Pythonista
      heyguy4
      heyguy4
    • RE: Loading images into gui.

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

      posted in Pythonista
      heyguy4
      heyguy4
    • How do I add textures to sprites?

      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
      heyguy4
      heyguy4