I have a texture which is positioned to the left of some text however they both need to be in the center. Is there a way that I can make the destination rect layer invisible instead of having the white background, or move the text forward to the top layer
?
You move the text to above the image by drawing the text after, not before, the image
And if you want to make the background of the texture transparent, you can use the alpha channel to “remove” the parts you don’t want: [RGBA] – the 4th value is alpha. When alpha is 0 or close to 0 that pixel is effectively transparent. See also my last answer for your previous question.
For bonus points and a more advanced use-case, PTB allows you to process a texture at drawing time to dynamically mask out a particular colour by adding a shader to the texture. See the BackgroundMaskOut
option of the CreateSinglePassImageProcessingShader
function.
But the easiest solution is @dcnieho’s answer, just change the order of drawing!
Thanks! much appreciated