Your images have no transparency (RGB). You need will need to specify an alpha channel to do transparency: RGBA and a fourth value for each pixel.
On Wednesday, March 11, 2020 at 5:57:27 PM UTC-5, Jonathon Parker wrote: > > In my test the images are the same size, but I thought the background was > transparent. Any way to specify a background color is transparent? Or is > there a better way to layer images? > > On Wednesday, March 11, 2020 at 6:44:00 PM UTC-4, Charles M wrote: >> >> This is normal behavior, blit overwrites the pixel data with new data you >> are providing. Which in this case is an entirely new image. >> >> On Wednesday, March 11, 2020 at 2:34:15 PM UTC-5, Jonathon Parker wrote: >>> >>> A minimal example >>> >>> # rawdata1 and rawdata2 are a list of c_ubytes >>> >>> my_texture_region = pyglet.image.ImageData(x, y, 'RGB', >>> rawdata1).get_texture() >>> my_image = pyglet.image.ImageData(x, y, 'RGB', rawdata2) >>> my_texture_region.blit_into(my_image, 0, 0, 0) >>> >>> When I create a sprite using my_texture region, I only see my_image. >>> What I want is my_image on top of my_texture_region. >>> >>> What am I doing wrong? >>> >>> >>> -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/pyglet-users/93ba88b6-3549-44d5-83b0-c0f619d56acf%40googlegroups.com.