Would be appreciated as well.
Forum
CS2D Scripts Detecting the player cursor on an inaccurate imageDetecting the player cursor on an inaccurate image
2 replies 1
Would be appreciated as well.
You would somehow have to read and store the information which pixels are transparent. I can only think of two ways to do so:
write a PNG reader in Lua or use an existing one e.g.: https://github.com/Didericis/png-lua and use it to read, extract and store the alpha information
or do the PNG reading and processing beforehand with other software and somehow store the information in a format which can be read in Lua easily (or directly export the information as Lua table)
Afterwards you can use player mousemapx and mousemapy and the position of the Lua image to calculate the cursor position in the image and then - if the cursor hovers the image - check against your data if there is transparent pixel at that position or not.
1