Sprite breaking background image?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
sakohju
Newbie
Posts: 3
Joined: Sun Nov 14, 2021 4:26 pm
Deviantart: sakohju
Github: sakohju
itch: sakohju
Contact:

Sprite breaking background image?

#1 Post by sakohju »

I have a peculiar bug I've been trying to figure out. Every time a sprite of one particular character appears in my game, he breaks the background image and causes it to not display. I have no clue why this is. He's a .png just like all my other sprites, so I have no idea why it does this.
I've narrowed down the issue as probably something to do with the image file itself, as when any version if his sprite appears, it breaks, but when I comment it out it's fine. I've attached screenshots of the issue with the sprite(s) in question, and when I comment it out and the background works.

Any ideas as to what might be going on or how to fix this?
Attachments
break.png
no break.png
break 2.png

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Sprite breaking background image?

#2 Post by Alex »

What's the name of the sprite or the part of code that declares sprites and bg? What's the part of the code that shows all that sprites and bg? What line can be commented to not make bg image disappear?

sakohju
Newbie
Posts: 3
Joined: Sun Nov 14, 2021 4:26 pm
Deviantart: sakohju
Github: sakohju
itch: sakohju
Contact:

Re: Sprite breaking background image?

#3 Post by sakohju »

I've attached screenshots of the code below - the character declarations, and the line in particular from the screenshots I included above. It's the line where I show the noodle man's sprite, I've included screenshots of the line in question commented out and displaying a different sprite for the same character but different expression (like above). It doesn't just happen in this one spot, it's any time I'm showing a noodle man sprite, it breaks the background.
Attachments
broken alt sprite.png
regular commented.png
regular broken.png
character declarations.png

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Sprite breaking background image?

#4 Post by Alex »

sakohju wrote: Sat Nov 27, 2021 9:24 pm ... It doesn't just happen in this one spot, it's any time I'm showing a noodle man sprite, it breaks the background.
You've named bg image as 'noodle shop' and sprite as 'noodle sleazy'. Both have the same tag 'noodle', so they replace each other.
Try to rename all your bg images like 'bg noodle shop', so they will have 'bg' tag.

https://www.renpy.org/doc/html/displayi ... l#concepts

sakohju
Newbie
Posts: 3
Joined: Sun Nov 14, 2021 4:26 pm
Deviantart: sakohju
Github: sakohju
itch: sakohju
Contact:

Re: Sprite breaking background image?

#5 Post by sakohju »

That fixed it! Thank you so much!

Post Reply

Who is online

Users browsing this forum: Google [Bot], Red-Baby