Page 1 of 1

Using ImageData:setPixel for non rgba8 ImageData types

Posted: Sat Dec 07, 2024 12:32 pm
by lawrziepan
Currently im using an imagedata object to store the state of a grid in my game, and the most convenient way for me to do this is by using the "r8" ImageData type. How do I use the setPixel method when it expects r, g, b and a parameters, but my ImageData object only needs an r argument? Thanks

Re: Using ImageData:setPixel for non rgba8 ImageData types

Posted: Sat Dec 07, 2024 7:21 pm
by marclurr
It needs all the parameters and the underlying implementation ignores the superfluous ones if necessary.

Re: Using ImageData:setPixel for non rgba8 ImageData types

Posted: Sat Dec 07, 2024 8:58 pm
by lawrziepan
Oh, thank you