The problem with MAX_ALPHA and MIN_ALPHA
#2

Its something like that

pawn Код:
forward TextDrawVanish(Text: text, color); //needs an color parameter
public TextDrawVanish(Text: text, color) { //since there is no function to get it
    new
        alpha = color & 0xFF; //gets the alpha part of the color
    if(alpha) { //checks if the alpha is not 0
        if(alpha < 0x11) {
            color -= alpha;
        } else { //decrease the alpha ratio
            color -= 0x11;
        }
        TextDrawColor(text, color); //sets the new color
        SetTimerEx("TextDrawVanish", 1000, false, "ii", _: text, color); //recalls the function
    }
}
to add now a second parameter shouldnt be hard

Example:

recall time = 250ms (increased recall for a smoother vanish)

vanish time = 5s

ticks = vanish time / recall time

alpha decrease = 255 / ticks = 255 * recall time / vanish time = 255 * 250ms / 5s = 12.75
Reply


Messages In This Thread
The problem with MAX_ALPHA and MIN_ALPHA - by aniol16 - 30.06.2011, 19:32
AW: The problem with MAX_ALPHA and MIN_ALPHA - by Nero_3D - 30.06.2011, 19:55
Re: The problem with MAX_ALPHA and MIN_ALPHA - by aniol16 - 04.07.2011, 15:22
Re: The problem with MAX_ALPHA and MIN_ALPHA - by aniol16 - 15.07.2011, 15:03
Re: The problem with MAX_ALPHA and MIN_ALPHA - by aniol16 - 15.07.2011, 15:41

Forum Jump:


Users browsing this thread: 3 Guest(s)