Sprites not loading

Category: PyAngelo

Last updated 2 years ago

sofa carollo

sofa carollo Asked 3 years ago

I have loaded my sprite png into Pyangelo, but I am getting an OSError saying that my image has not been loaded into the code. Is this a common error? And is there a way to fix this?


Jeff Plumb

Jeff Plumb Answered 3 years ago

Are you able to share a link to your sketch? The most common issue is not having the exact spelling of the filename, or using the wrong file extension. We have also just implemented a change where instead of calling loadImage(), you should call Image() instead. The old loadImage() function will work for backwards compatibility.

Does the following line of code work for you?

hero = Image("/samples/images/PyAngelo.png")

Notify me of updates
Add to Favourites
Back to Questions

No comments yet!


Become a free member to post a comment about this question.