Hi for all.
I create a 64x64 buffer and fill it with red pixels. I use the Draw Pixel extension for this.
self.buffer_info = {
buffer = buffer.create(64* 64, {{name = hash("rgba"), type = buffer.VALUE_TYPE_UINT8, count = 4}}),
width = width,
height = height,
channels = 4
}
self.header = {
width = 64,
height = 64,
type = resource.TEXTURE_TYPE_2D,
format = resource.TEXTURE_FORMAT_RGBA,
num_mip_maps = 1
}
drawpixels.fill(self.buffer_info, 255, 0, 0, 0) -- Fills the buffer with filled pixels r,g,b,a
resource.set_texture(go.get("#sprite", "texture0"), self.header, self.buffer_info.buffer)
If I use drawpixels.fill(self.buffer_info, 255, 0, 0, 255) I get this:
For drawpixels.fill(self.buffer_info, 255, 0, 0, 0) I get this:
It is assumed that if the alpha channel is 0, then nothing should be displayed. Why does it work like this?
Blend Mode on sprite set to Alpha.
Thank you!