Exemple #1
0
        public StarwarRule2()
        {
            BaseGame.ShowMouse = true;

            bgTexture               = BaseGame.ContentMgr.Load <Texture2D>(Path.Combine(Directories.BgContent, "bg2"));
            npTexture               = BaseGame.ContentMgr.Load <Texture2D>(Path.Combine(Directories.UIContent, "namepass2"));
            bgRect                  = new Rectangle(0, 0, 800, 600);
            namebox                 = new Textbox("namebox", new Vector2(320, 400), 150, "", false);
            passbox                 = new Textbox("passbox", new Vector2(320, 430), 150, "", false);
            passbox.bStar           = true;
            namebox.maxLen          = 20;
            passbox.maxLen          = 20;
            btnLogin                = new TextButton("OkLogin", new Vector2(320, 480), "Login", 0, Color.Gold);
            btnClear                = new TextButton("ClearBtn", new Vector2(405, 480), "Clear", 0, Color.Gold);
            SocketMgr.OnReceivePkg += new SocketMgr.ReceivePkgEventHandler(OnReceivePack);
            btnLogin.OnClick       += new EventHandler(btnLogin_OnPress);
            btnClear.OnClick       += new EventHandler(btnClear_OnPress);
            wait      = 0;
            bHasError = false;

            SocketMgr.Initial();

            //heartTimer = new Timer(1000);
            //heartTimer.Elapsed += new ElapsedEventHandler(heartTimer_Tick);
        }