The problem is very simple. I want to change the Blendmode for my SDL2 Renderer in Python, but I don't know how to access the Renderer.
The PySDL2 Documentation here states that you can define colors with an Alpha channel:
class sdl2.ext.Renderer
blendmode: The blend mode used for drawing operations (fill and line). This can be a value of
. SDL_BLENDMODE_NONE for no blending
. SDL_BLENDMODE_BLEND for alpha blending
. SDL_BLENDMODE_ADD for additive color blending
. SDL_BLENDMODE_MOD for multiplied color blending
All I need is to set the Blendmode to SDL_BLENDMODE_BLEND so that I can use the Alpha channels. My problem is that I'm using a SoftwareSpriteRenderSystem
self.Renderer = self.SpriteFactory.create_sprite_render_system(self.Window)
There isn't any clear way to change the blendmode here. I can try doing the following:
SDL_SetRenderDrawBlendMode(self.Renderer,SDL_BLENDMODE_BLEND)
But this returns:
ArgumentError: argument 1: <type 'exceptions.TypeError'>: expected LP_SDL_Renderer instance instead of SoftwareSpriteRenderSystem
Could anyone help me out please? I'd just like to be able to get some transparent Sprites (from_rect sprites), but it's proving difficult because the SDL_renderer is inaccessible.