Making Masks

F

FlameFrog

Guest
Hey GMC, question for you guys.

I'm making a bunch of sprites that have a bunch of colored in parts and a bunch of black parts on them. Now, for the objects that display these sprites I want the mask to be a precise mask over ONLY the black part. What I'm doing right now is making a second sprite for my mask (that just has the black part). But this just doesn't feel right. First of all, these sprites are big and this is going to fill up my texture pages incredibly fast (which will slow this down, correct?). Second of all, it's just messy in my game maker folder to have so many sprites (two for every one of these).

So there's got to be a better way to do this, right?
Figured someone here would know.

Thanks in advance

ps it's good to be back.
 
S

Snail Man

Guest
If the sprites are relatively contoured (not just squares/circles), I'm afraid I don't know of a better way
 

obscene

Member
You'd need to show some images to get the best advice for your situation. Are the black parts all spaced out across the sprite or is a large portion of the sprite black? If they are spaced out are they all uniform in shape? Relatively uniform?

What I might think about would be to create mask objects of a vew various shapes that you can use throughout several objects. Say you have a round mask, a square mask and a triangle mask. When you create your object you also create several of these hitboxes as needed and you move them along with the object. Each hitbox has a variable storing the instance that created them so if they are hit the effects/damage can be sent to the main instance.
 
F

FlameFrog

Guest
Thanks for the responses, guys! I might try re-doing it with a bunch of smaller mask objects. These sprites represent environments in the game (basically the inside of a building with several rooms) and the masked part represent all the solid blocks the player can't move through. So I'll probably just end up either doing what I'm doing or constructing the blocks out of another object in the room editor. I suppose I'm just trying to avoid using the room editor as much as possible, haha.
 
Top