able-printer-41379
05/27/2023, 8:26 PMable-printer-41379
05/27/2023, 8:26 PMhallowed-ocean-84954
05/27/2023, 8:36 PMable-printer-41379
05/27/2023, 8:43 PMshader.data.openfl_TextureCoordv.value = [...]
happenhallowed-ocean-84954
05/27/2023, 9:27 PMenough-lawyer-1858
05/27/2023, 10:11 PMsetPixels()
function in BitmapData
and I got curious
how should the ByteArray
behave so that the pixel transformation is set correctly?enough-lawyer-1858
05/27/2023, 10:11 PMenough-lawyer-1858
05/27/2023, 10:13 PMBitmapData
, and I wanted the pixels to turn red at positions (0,0)
and (5, 1)
how could I do that?hallowed-ocean-84954
05/27/2023, 10:42 PMenough-lawyer-1858
05/27/2023, 10:54 PMhallowed-ocean-84954
05/27/2023, 10:56 PMenough-lawyer-1858
05/27/2023, 10:57 PMhaxe
var bitmapData = new BitmapData(10, 2, 0);
var byteArray = new ByteArray(bitmapData.width * bitmapData.height);
// and then do some loop that sets the colors to transparent and then calculate the position depending on which pixel is it, like if (5, 1), then position = 10
enough-lawyer-1858
05/27/2023, 10:58 PMhallowed-ocean-84954
05/27/2023, 10:59 PMhallowed-ocean-84954
05/27/2023, 11:00 PMfor i 0...btimaptData.height {
for j 0...bitmapData.width {
set byte value for the pixel
}
}
enough-lawyer-1858
05/27/2023, 11:00 PMhallowed-ocean-84954
05/27/2023, 11:00 PMenough-lawyer-1858
05/27/2023, 11:01 PMenough-lawyer-1858
05/27/2023, 11:01 PMenough-lawyer-1858
05/27/2023, 11:01 PMenough-lawyer-1858
05/27/2023, 11:02 PMable-printer-41379
05/28/2023, 5:17 PMable-printer-41379
05/28/2023, 5:17 PMhallowed-ocean-84954
05/28/2023, 5:32 PMable-printer-41379
05/28/2023, 6:55 PMhallowed-ocean-84954
05/28/2023, 6:58 PMable-printer-41379
05/28/2023, 7:46 PMable-printer-41379
05/28/2023, 7:47 PMhallowed-ocean-84954
05/28/2023, 7:48 PMhallowed-ocean-84954
05/28/2023, 7:49 PM