Hello,
I am using the code snippet example in the memoryBitmap plugin and modified it to check for the alpha parameter in the setPixel function (Setting alpha to 1 and 0.5)
I do not see any change in the alpha on the display. Is there an issue ?
local memoryBitmap = require( "plugin.memoryBitmap" )
-- Create bitmap texture
local tex = memoryBitmap.newTexture(
{
width = 100,
height = 100,
-- format = "rgba" -- (default)
-- format = "rgb"
-- format = "mask"
})
-- Create image using the bitmap texture
local bitmap = display.newImageRect( tex.filename, tex.baseDir, 100, 100 )
bitmap.x = display.contentCenterX
bitmap.y = display.contentCenterY
-- Loop through all pixels and set green channel to 1
for y = 1,tex.height do
for x = 1,tex.width do
if (y % 2 == 0) then
tex:setPixel( x, y, 0, 1, 0, 1 )
else
tex:setPixel( x, y, 0, 1, 0, 0.5 )
end
tex:invalidate()
end
end
-- If no more modifications are required, release the texture
tex:releaseSelf()