Using ImageData:setPixel for non rgba8 ImageData types

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
lawrziepan
Prole
Posts: 2
Joined: Sat Dec 07, 2024 12:22 pm

Using ImageData:setPixel for non rgba8 ImageData types

Post 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
User avatar
marclurr
Party member
Posts: 157
Joined: Fri Apr 22, 2022 9:25 am

Re: Using ImageData:setPixel for non rgba8 ImageData types

Post by marclurr »

It needs all the parameters and the underlying implementation ignores the superfluous ones if necessary.
lawrziepan
Prole
Posts: 2
Joined: Sat Dec 07, 2024 12:22 pm

Re: Using ImageData:setPixel for non rgba8 ImageData types

Post by lawrziepan »

Oh, thank you
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 3 guests