GMS 2 Expressions inside a variable

Im trying to ease in the alpha of a rectangle I drew to the screen. It draws fine of course. Just cant get my brain around how to ease in the alpha. I know how to set the actual script for easing and i have that. It just doesnt animate. Which makes me think you cant do it how I am doing it. Im guessing you cant put a variable with an expression inside the set alpha built in script.

Code:
var boxColor    = c_red;

var _time        = 0;
var _start        = 0;
var _end        = 1;
var _duration    = 120;
var _result        = ease_linear(_time, _start, _end, _duration);

if (_time < _duration) {
    draw_set_alpha(_result);
    _time++;
}

draw_rectangle_color(0, 0, room_width, room_height, boxColor, boxColor, boxColor, boxColor, false);
draw_set_alpha(1);
 
Top