I have a freeze gun in my game, and I would like enemies that are frozen to be tinted light blue. I can't get it to work though. Nothing I try makes them blue. Frozen amount is just how many times they were hit by a freezing bullet. So it could be anywhere from 0 to like 20. Here is one of my attempts at getting it to work.

No, neither of those really help you draw something lighter, unless you use additive blending, but that's not the same as tinting. You probably need a shader to do this without having some other kind of intermediate bitmap, such as a mask.

Like I said, it multiplies the two values together and then divides by 255, which is the same as multiplying by a fraction if you use floats, so it just gets darker. You could use additive blending, but that tends to white out large portions of the image.

It should be a fairly simple thing to make a function that creates a mask for your sprite.

Algorithm :1. Create a mask bitmap the same size as your sprite.2. Clear the mask bitmap to light blue zero alpha.3. Draw the alpha layer of the mask bitmap. Look at the src bitmap and wherever it has alpha 0, you want alpha 0 on your mask bitmap (which you can get by leaving that pixel alone). Wherever it has non-zero alpha, you want to set the alpha to the percent they are frozen.4. When you draw your sprite, draw the mask over the top of it using normal alpha blending (not the same as the default blending, which is pre-multiplied alpha).5. Draw the sprite and the mask to a buffer to cache resulting bitmaps.

It would be hard to do dynamic freeze levels this way, but it would get you the effect you are looking for, tinting your sprite.