gl_tex_infoto read out the pixels in an image using OpenGL, but that's exactly what
Image#to_blobis doing for you, except that you need an extension to make use of
Image#method I've linked to is the exact equivalent of the Löve2D function you've mentioned. But if you need a way to read out an individual image's pixels _under the mouse cursor_, you also need to know where each image has been drawn. You can't take a screenshot of the window and read individual pixels from that (at least not without extensions).
@country_image[(mouse_x - @image_left).to_i, (mouse_y - @image_top).to_i]. If
pixel.ord != 0, the pixel is not transparent.
Image#with some bounds checking in the old post I've linked to above. Also,
:retroonly sets a few OpenGL parameters that change how the image is rendered when it is stretched or rotated, it does not affect the image's pixel data.)
> Also, :retro only sets a few OpenGL parameters that change how the image is rendered when it is stretched or rotated, it does not affect the image's pixel data.
enable_undocumented_retroficationwas a only temporary hack while I was working on the
:retroflag, which is the new way of doing things:
Image.new("filename.png", retro: true)
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill