Draw event not drawing my rectangle

Discussion in 'Programming' started by Theghost, Feb 10, 2019.

  1. Theghost

    Theghost Member

    Joined:
    Feb 1, 2019
    Posts:
    11
    Hi guys,
    I've encountered a problem where my rectangle doesn't show up on the screen. It is not my first time using the draw event but it is still not working. could you please help me for a second?
    Code:
    //create event
    draw = false;
    fade = 1;
    
    //step event
    if(collision_circle(x,y,50,obj_player,false,false) && keyboard_check(ord("E")))
    {
        draw = true;
        fade -= 0.01 ;
        global.realisticTimerH = 7;
        global.realisticTimerM = 0;
        with(obj_timer_and_stamina_counter)
        {
            stamina = 160;   
        }
    }
    
    //draw event
    if(draw == true)
    {
        draw_set_color(c_white);
        draw_rectangle(0,0,1024,768,false);
    }
     
  2. TsukaYuriko

    TsukaYuriko Q&A Spawn Camper Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    1,535
    Is draw set to true? Does any other code run when put inside the body of that if statement in the Draw event?
    Is the object marked as visible?
    Is an instance of the object in the room?
    Is a camera defined, active and visible?
    Is anything else being drawn that may shadow this?
    Is anything drawn at all?
     
  3. TheouAegis

    TheouAegis Member

    Joined:
    Jul 3, 2016
    Posts:
    6,627
    Is this code NOT inside obj_player?
     
  4. Theghost

    Theghost Member

    Joined:
    Feb 1, 2019
    Posts:
    11
    yes
    oh ****, I'm stupid.
    yes
    yes
    no
    yes
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice