Sk8dududu
Member
I'm trying to get a sort of "blinking" text effect, except the text fades in and out. I have the code to fade the text in already, and its working fine, and I've been messing around but I cannot get it to fade out after 1 second at the same speed it faded in, and of course to continue to repeat that action.
This is my code for the create event of my text controller.
alarm 0 event
I have alarm 0 starting at 300 steps because that is when I want the text to start fading in, not right when the room starts.
step event
and of course the draw event
what do I need to add to fade out and then continue to repeat this until i destroy the object?
This is my code for the create event of my text controller.
Code:
//Variables
draw = 0;
text_alpha = 0;
fadeSpeed = 0.005;
//Set alarm
alarm_set(0,300);
Code:
///Start fade
draw = 1;
step event
Code:
//fade in / out
if (draw && text_alpha < 1)
{
text_alpha += fadeSpeed;
}
Code:
//Draw "Presents"
if (text_alpha > 0)
{
draw_set_alpha(text_alpha);
draw_set_color(c_white);
draw_set_font(font_intro1);
draw_text(x,y,"Presents");
}