Sprites not loading

Category: PyAngelo

Last updated 5 months ago

sofa carollo

sofa carollo Asked 11 months 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 10 months 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

Thoughts on this question

Jason Lu

Jason Lu Posted 9 months ago

Same


Jeff Plumb

Jeff Plumb from PingSkills Posted 8 months ago

Thanks for posting this question. A bug was introduced when the ability to preview images was added. The bug caused the image to be overwritten when it was viewed and then the Python code tab was clicked. This has been fixed now. If you have any missing images you'll need to delete the file from the editor, and then re-upload the image. This should resolve any issues. And any new sketches you create should be fine. Let me know if this fixes the problem and if you find any other issues. Sorry for the problems.


Ayaan a47

Ayaan a47 Posted 5 months ago

ok bro



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