var/offset = rand(-12, -14)
world << "Doing icon blend thing"
//Lets cutoff part of the plant
var/icon/I = getFlatIcon(src)
I.Blend(new /icon('icons/obj/hydroponics_vines.dmi', "blank"),ICON_MULTIPLY, y=abs(offset-1))
icon = I
src.transform = M
Hi all. I'm attempting to do something that should be very simple, i want to cut off the bottom of a sprite. At runtime. A perfectly even horizontal cut.
The code above is how i'm trying to do it, the blank icon state is just a square sprite fully colored in with white, and i'm trying to blend it at an offset.
My idea is, by offsetting it upwards, all the pixels below a certain point should be transparent, and when blended with the underlying icon, it should OR the transparent pixels and blank out all parts that are transparent in either image.
It is not working though, appears to do nothing
I've confirmed it is doing something though, I tested with blend underlay (in a prob(50)) and got this.
That colored square is in more or less the right place. Everything below it is supposed to be cutoff and completely transparent, according to the docs. I don't understand why it isn't
My use case here, incase its not clear. I've got these plants that i want to look like they're growing out of the wall. And since we use a perspective view, that means they have to be covered by the north side of the wall, but be visible on other sides of it.
Adjusting layers and planes isn't a practical solution here, due to that affecting interactions with other objects, so i'm trying to make this work instead.
The plant does move via transform translation instead of pixel offset, could that be related? Or does blend offset not work how i'm expecting