T
Tony Lukasavage
Guest
Hey, first post so forgive if I miss any etiquette.
I'm having trouble getting draw_set_alpha to behave as expected. My draw_set_alpha calls do not make the triangles disappear when triangle_visible equals zero (on a repeating timer in the step event). I know for a fact that the value is set to zero during my game for 2 reasons. 1, I checked with a show_debug_message() call, but more importantly, if I don't uncomment that last line that resets the alpha to 1, then other parts of my game will flicker in and out of visibility, just like I would expect these triangles to do. Just to give all details, the other parts of my game that are flickering are sprites, while the triangles are obviously drawn.
One additional note is that if the initial value of triangle_visible is zero, then the triangles will be invisible for the first iteration of the timer. After the first time it is made visible though, it stays visible forever, even though as stated earlier, other parts of my game will continue to flicker in and out of visibility. It's as though once it is drawn once it will never disappear.
I'm new, so I'm hoping I'm missing something simple.
Not sure if it's necessary but here's the step event that changes the triangle_visible variable, that I am certain is working due to the behavior of the rest of the game.
and here's the create event where the variables are set
I'm having trouble getting draw_set_alpha to behave as expected. My draw_set_alpha calls do not make the triangles disappear when triangle_visible equals zero (on a repeating timer in the step event). I know for a fact that the value is set to zero during my game for 2 reasons. 1, I checked with a show_debug_message() call, but more importantly, if I don't uncomment that last line that resets the alpha to 1, then other parts of my game will flicker in and out of visibility, just like I would expect these triangles to do. Just to give all details, the other parts of my game that are flickering are sprites, while the triangles are obviously drawn.
One additional note is that if the initial value of triangle_visible is zero, then the triangles will be invisible for the first iteration of the timer. After the first time it is made visible though, it stays visible forever, even though as stated earlier, other parts of my game will continue to flicker in and out of visibility. It's as though once it is drawn once it will never disappear.
I'm new, so I'm hoping I'm missing something simple.
Code:
draw_set_alpha(0.66 * triangle_visible);
draw_set_color(c_black);
draw_triangle(
x + shadow_offset,
y + shadow_offset,
x + size + shadow_offset,
y + shadow_offset,
x + size/2 + shadow_offset,
y + size + shadow_offset,
false
);
draw_set_alpha(1 * triangle_visible);
draw_set_color(color);
draw_triangle(
x,
y,
x + size,
y ,
x + size/2,
y + size,
false
);
//draw_set_alpha(1);
Code:
timer++;
if (triangle_visible == 1 && timer > 40) {
triangle_visible = 0;
timer = 0;
} else if (triangle_visible == 0 && timer > 20) {
triangle_visible = 1;
timer = 0;
}
Code:
size = 20;
color = c_white;
shadow_offset = 3;
triangle_visible = 1;
x = 0;
y= 0;
timer = 0;