GMS 2 [help] How to use draw_line make a Scrolling 80's Retro Neon Grid?

I want to make a menu background just like Far Cry 3 Blood Dragon,and i have already been trying for a few days,but i just can't figure it out! I think my code is really awful. now i have two problems wan't to figure out.
1. i was using code like this to draw vertical lines
Code:
    // draw vertical lines

    var c_pp = make_color_rgb(178,17,173);
    var c_bb = make_color_rgb(81,85,204);
    var c_pl = make_color_rgb(229,114,225);
    var c_bl = make_color_rgb(153,156,255);  
    var ww = window_get_width();
    var wh = window_get_height();

    var dirr = -ww*10;
    
    for (var i = 0; i < 87; i++)
    {
        draw_line_color(ww/2, wh/2, dirr, wh, c_pp, c_bb);
        draw_set_alpha(0.2);      
        draw_line_color(ww/2, wh/2, dirr, wh, c_pl, c_bl);
        draw_set_alpha(0.4);              
        dirr += 64*4
    }
it's perfect when i run it! but there's a problem, it cant adapt when window width changed!
so how to draw self-adapting vertical lines?

The second question is how to make horizontal lines scrolling to the bottom with fake perspective?
i use single objects to draw each lines and give it a vertical speed and when it out of window height then y move to window height / 2 but this can't work with fake perspective because all vertical speed a same

this is how i create horizontal lines
Code:
    var ww = window_get_width();
    var wh = window_get_height();
    // create vertical lines objects
    var h = 8;
    var hl
    // draw horizontal lines
    for(var i = wh/2+16; i < wh; i+=h;)
    {
        hl = instance_create_layer(ww/2, i, "instances_bottom", menu_bg_horizon_line);
        h+=8;
    }
I am very grateful that you can spend time to reading my questions and sorry for my English.
 
Last edited by a moderator:
Maybe you should not draw the lines based on the size of the window but instead the size of the room. Then any resizing you do, you do by resizing the surface. At least that's how I would think about fixing your first problem.
 
Top