ID:2903389
 
Code:


Problem description:

Hello so I was playing a game and saw something amazing but I’m having the hardest time re creating it. I actually don’t even know how it’s possible. So let’s say you have a players icon and you have a flashy icon for teleporting. In the .dm file the icon takes up almost an entire tile. Somehow I saw this same icon take up ONLY the icon of what it was being used on and not the tile in the background or around said item. I’m hoping that isn’t confusing but another example

You have a rock on screen. You use the teleport icon on the rock but only the rock has any overlays added, not the entire tile the rock takes up(or however much the tp icon requires)

I’m hoping I explained that okay- does anyone know where I could even find a reference on how to reciprocate this? I’ll keep trying different codes- if I accidentally stumble on something similar I’ll post what I came up with lol. Thanks for any help!

Update~
I took a video of the game with an example but youtube was the only way I could think to get it on this post.

https://youtu.be/e-2wCHRxbYw
The idea here is that you add KEEP_TOGETHER to the icon you're using as a mask, and then you add the flashy teleport icon as an overlay to that with either BLEND_INSET_OVERLAY or BLEND_MULTIPLY. Probably BLEND_MULTIPLY is the better choice so the object can fade out, or you can maybe switch from one to the other.

Alternatively, you can add an alpha mask filter to the icon you're teleporting, with a MASK_SWAP flag. This is probably a harder approach though, since mask sources can't be animated unless they use a render source.
:O Thanks for the info! I'll go look into the stuff :D
In response to Lummox JR
Is there anyway to get an example of this? I've been trying to find stuff related to how I want to use it but I can't lol. I've been having a hard time just finding information about KEEP_TOGETHER and BLEND_MULTIPLY. Thanks for any help :).
All of this is in the BYOND reference, so you can search that. KEEP_TOGETHER is in appearance_flags, and BLEND_MULTIPLY or BLEND_INSET_OVERLAY are listed under blend_mode.
If the byond reference is the "Help on.." Section in the dream maker then there's a decent example of blend_multi that I can use but for keep_together I'm still a little lost and there's barely a paragraph about it. Is there another section I'm not seeing?
obj/mask
appearance_flags = KEEP_TOGETHER
New()
vis_contents.Add(new/obj/thing_inside_mask)

obj/thing_inside_mask
blend_mode = BLEND_INSET_OVERLAY
Okay so you all probably think I'm dumb lol but I'm trying really hard to understand this.

In what Kozuma3 says: the obj/mask would be my mob I want the teleport icon to take the shape of and the "thing in the mask" would be the teleport icon?

If this is true, how do I get keep_together to cover ALL mobs so I can apply blend_inset_overlay to the teleport icon? When I try to put it in my "mob/var" it tells me it conflicts with built-in var.

*I know kozuma used objs but I'd like my icon to take the shape of mobs.

I REALLY don't mind reading up on this myself but I can barely find any information bigger than a paragraph for most of this stuff D=. I've even tried to look for demos in the repository that use these things to try and see more examples.
lmao I actually figured it out! Thanks so much for all your help Lummox and Kozuma :D!