Closed thomanimation closed 6 years ago
You could try padding all your sprites with a 1 or 2 pixel transparent border.
Anything fix that?
This can be fixed by implementing the following changes in the pygame_sdl2/render.pyx file:
if DEBUG_DRAW_BBOX:
# TODO: Adjust for rotation.
self.adjust_rect(&dest_rect, &self.bounding_box, &real_dest)
SDL_SetRenderDrawColor(tex.renderer, 0x00, 0x00, 0x00, 0x00)
#SDL_RenderDrawRect(tex.renderer, &real_dest)
SDL_SetRenderDrawColor (tex.renderer, 0xFF,0x00,0xFF,0xFF) actually creates a magenta brush while SDL_RenderDrawRect draws a rect around the borders using the colour specified in SDL_SetRenderDrawColor.
So change the colour to black, with transparency, and don't draw a rect around the borders, otherwise, you will get black borders around each sprite. Compile the code from source and test.
I will try and submit a PR for this.
Is this fixed? I encountered the same thing when i made one of my TextureNode/texture a sprite because i wanted to be able to rotate it.
texture = obj.game.r.load_texture(image) ---> texture = pg.render.Sprite(texture) <---
tested eshikafe fix and it works
Thank you renpytom.
Today I switched from blitting surfaces to using the Renderer and saw amazing improvement in FPS.
Now I've stumbled upon a small issue, as seen here:
There's a magenta border around every PNG with transparency and I'd like to get rid of it.
A JPG or a PNG with non-transparent background displays without the magenta border. Also, there was no magenta border before switching to the renderer method: http://www.thomanimation.com/game/
I'm using pygame_sdl2 v. 2.0.0 (available in the Ubuntu Xenial Repo) Unfortunately I couldn't access the page http://nightly.renpy.org/pygame_sdl2/ (404)