@name EGP Interactive Screen v2
@inputs E:wirelink User:entity
@outputs
@persist Menu:string
    
if (~User & User) { #If someone pressed use on the screen
    Pos = E:egpCursor(User)
    
    X = Pos:x()
    Y = Pos:y()
    print(X+ " :100")
    print(Y + " :350")
    if (Menu == "Main Menu") {  
         
        if (inrange(Pos,vec2(100,350),vec2(400,450))) {
            Menu = "Submenu 1"
            timer("UpdateMenu",1)
        }
    } elseif (Menu == "Submenu 1") {
        if (inrange(Pos,vec2(120,375),vec2(420,420))) {
            Menu = "Main Menu"
            timer("UpdateMenu",1)
        }
    }
} elseif (clk("UpdateMenu")) {
    #Clear the screen
    E:egpClear()
    
    if (Menu == "Main Menu") {
        #Background picture
        E:egpBox(1,vec2(15,15),vec2(480,480))
        E:egpMaterial(1,"console/background01.vtf")
        
        #Text box
        E:egpRoundedBox(2,vec2(100,350),vec2(300,100))
        E:egpColor(2,vec(30,30,30))
        
        #Text
        E:egpTextLayout(3,"Click To Begin",vec2(120,375),vec2(300,300))
        E:egpSize(3,45)
    } elseif (Menu == "Submenu 1") { #Rename this menu if you want
        #Some strange red box (I assume this isn't finished yet)
        E:egpBox(1,vec2(15,15),vec2(480,480))
        E:egpColor(1,vec(200,20,20))
        
        #Text
        E:egpTextLayout(2,"Click To Return",vec2(120,375),vec2(300,300))
        E:egpSize(2,45)
    }
    
    #Create cursor (Create this last so it's above everything else)
    E:egpCircle(5,vec2(-5,-5),vec2(5,5))
    E:egpParentToCursor(5)
    E:egpColor(5,vec(255,0,0))
} elseif (first()) {
    E:egpDrawTopLeft(1) #I noticed your boxes weren't aligned properly. This fixes it without you having to change the positions in the code.
    Menu = "Main Menu"
    timer("UpdateMenu",1)
}
