private void ChattingInput_OnEnter(object sender, string s)
        {
            ClientManager.Instance.SendChat(s);
            TextInputField input = sender as TextInputField;

            input.Clear();
        }
 private void Dispose()
 {
     background     = null;
     idInput        = null;
     passwordInput  = null;
     loginButton    = null;
     toSignUpButton = null;
 }
Example #3
0
        public override void Release()
        {
            Destroy(createButton);
            Destroy(cancelButton);
            Destroy(roomNameInput);

            createButton  = null;
            cancelButton  = null;
            roomNameInput = null;
        }
Example #4
0
 private void Dispose()
 {
     background       = null;
     roomNameBG       = null;
     chattingView     = null;
     chattingInput    = null;
     roomChangeToggle = null;
     roomNameView     = null;
     roomListViewer   = null;
 }
Example #5
0
        private void RoomNameInput_OnEnter(object sender, string roomName)
        {
            if (string.IsNullOrWhiteSpace(roomName))
            {
                MessageBox.Show("방 제목에는 공백 문자가\n포함될 수 없습니다.", "알림");
                return;
            }

            ClientManager.Instance.CreateRoom(roomName);
            ClientManager.Instance.JoinRoom(roomName);

            TextInputField input = sender as TextInputField;

            input.Clear();
        }
        private void InitializeComponent()
        {
            #region UI RESOURCE INITIALIZE SOURCE CODE

            /// <summary>
            /// roomNameInput UI Resource Initialize
            /// </summary>
            roomNameInput = new TextInputField("ChatInputFont");

            roomNameInput.Position     = new Vector3(275, 50, 0);
            roomNameInput.FieldTexture = D3D9Manager.Instance.FindTexture("RoomNameInput");
            roomNameInput.MaxLength    = 10;
            roomNameInput.StringColor  = new Color(127, 127, 127);
            roomNameInput.StringOffset = new Vector3(25, 8, 0);
            roomNameInput.OnEnter     += RoomNameInput_OnEnter;

            /// <summary>
            /// createButton UI Resource Initialize
            /// </summary>
            createButton = new Button();

            createButton.ButtonTexture     = D3D9Manager.Instance.FindTexture("RoomCreateButton");
            createButton.Position          = new Vector3(650, 50, 0);
            createButton.Scale             = new Vector3(1.0f, 1.0f, 1.0f);
            createButton.IsMouseOverResize = true;
            createButton.OnButtonClick    += roomNameInput.EnterText;

            /// <summary>
            /// roomListViewer UI Resource Initialize
            /// </summary>
            roomListViewer = new NetworkRoomListViewer();

            roomListViewer.Position = new Vector3(-5, 80, 0);


            GameObjectManager.Instance.AddObject(roomNameInput);
            GameObjectManager.Instance.AddObject(createButton);
            GameObjectManager.Instance.AddObject(roomListViewer);

            #endregion
        }
Example #7
0
        public override void Initialize()
        {
            D3D9Manager.Instance.CreateFont("CreateWindowInputFont", "Segoe UI", 50, false);

            background = D3D9Manager.Instance.CreateTexture("CreateRoomWindowBG", "./Resource/CreateRoomWindow.png");

            createButton = new Button();

            createButton.ButtonTexture     = D3D9Manager.Instance.CreateTexture("CreateButton", "./Resource/Create.png");
            createButton.IsMouseOverResize = true;
            createButton.Parent            = this;
            createButton.Position          = new Vector3(-187, 130, 0);
            createButton.UseParentMatrix   = true;
            createButton.OnButtonClick    += CreateButton_OnButtonClick;

            cancelButton = new Button();

            cancelButton.ButtonTexture     = D3D9Manager.Instance.CreateTexture("CancelButton", "./Resource/Cancel.png");
            cancelButton.IsMouseOverResize = true;
            cancelButton.Parent            = this;
            cancelButton.Position          = new Vector3(198, 134, 0);
            cancelButton.UseParentMatrix   = true;
            cancelButton.OnButtonClick    += CancelButton_OnButtonClick;

            roomNameInput = new TextInputField("CreateWindowInputFont");

            roomNameInput.Position     = new Vector3(0, 0, 0);
            roomNameInput.FieldTexture = D3D9Manager.Instance.CreateTexture("RoomNameInput", "./Resource/RoomNameInput.png");
            roomNameInput.StringOffset = new Vector3(20, 0, 0);
            roomNameInput.Text         = "New Room";
            roomNameInput.MaxLength    = 15;
            roomNameInput.Parent       = this;

            GameObjectManager.Instance.AddObject(createButton);
            GameObjectManager.Instance.AddObject(cancelButton);
            GameObjectManager.Instance.AddObject(roomNameInput);
        }
        private void InitializeComponent()
        {
            #region UI RESOURCE INITIALIZE SOURCE CODE

            /// <summary>
            /// idInput UI Resource Initialize
            /// </summary>
            idInput = new TextInputField("InputField");

            idInput.Position     = new Vector3(705, 177, 0);
            idInput.FieldTexture = D3D9Manager.Instance.FindTexture("NameInput");
            idInput.MaxLength    = 15;
            idInput.StringColor  = new Color(127, 127, 127);
            idInput.StringOffset = new Vector3(30, 6, 0);


            /// <summary>
            /// passwordInput UI Resource Initialize
            /// </summary>
            passwordInput = new TextInputField("InputField");

            passwordInput.Position     = new Vector3(705, 241, 0);
            passwordInput.FieldTexture = D3D9Manager.Instance.FindTexture("NameInput");
            passwordInput.MaxLength    = 15;
            passwordInput.StringColor  = new Color(127, 127, 127);
            passwordInput.StringOffset = new Vector3(30, 6, 0);


            /// <summary>
            /// userNameInput UI Resource Initialize
            /// </summary>
            userNameInput = new TextInputField("InputField");

            userNameInput.Position     = new Vector3(705, 305, 0);
            userNameInput.FieldTexture = D3D9Manager.Instance.FindTexture("NameInput");
            userNameInput.MaxLength    = 15;
            userNameInput.StringColor  = new Color(127, 127, 127);
            userNameInput.StringOffset = new Vector3(30, 6, 0);


            /// <summary>
            /// signUpButton UI Resource Initialize
            /// </summary>
            signUpButton = new Button();

            signUpButton.ButtonTexture     = D3D9Manager.Instance.FindTexture("SignupButton");
            signUpButton.Position          = new Vector3(637, 381, 0);
            signUpButton.Scale             = new Vector3(1.0f, 1.0f, 1.0f);
            signUpButton.IsMouseOverResize = true;
            signUpButton.OnButtonClick    += SignUpButton_OnClick;


            /// <summary>
            /// signUpButton UI Resource Initialize
            /// </summary>
            toSignInButton = new Button();

            toSignInButton.ButtonTexture     = D3D9Manager.Instance.FindTexture("BackButton");
            toSignInButton.Position          = new Vector3(48, 48, 0);
            toSignInButton.Scale             = new Vector3(1.0f, 1.0f, 1.0f);
            toSignInButton.IsMouseOverResize = true;
            toSignInButton.OnButtonClick    += ToSignInButton_OnClick;

            /// <summary>
            /// signUpButton UI Resource Initialize
            /// </summary>
            background = new TextureObject();

            background.Position = new Vector3(ClientWindow.Width / 2, ClientWindow.Height / 2, 0);
            background.Scale    = new Vector3(1, 1, 1);
            background.Texture  = D3D9Manager.Instance.FindTexture("Background");


            /// <summary>
            /// Add To GameObject Manager
            /// </summary>
            GameObjectManager.Instance.AddObject(background);
            GameObjectManager.Instance.AddObject(idInput);
            GameObjectManager.Instance.AddObject(passwordInput);
            GameObjectManager.Instance.AddObject(userNameInput);
            GameObjectManager.Instance.AddObject(signUpButton);
            GameObjectManager.Instance.AddObject(toSignInButton);


            #endregion
        }
 private void Dispose()
 {
     roomNameInput  = null;
     createButton   = null;
     roomListViewer = null;
 }
        private void InitializeComponent()
        {
            #region UI RESOURCE INITIALIZE SOURCE CODE

            /// <summary>
            /// background UI Resource Initialize
            /// </summary>
            background = new TextureObject();

            background.Position = new Vector3(ClientWindow.Width / 2, ClientWindow.Height / 2, 0);
            background.Scale    = new Vector3(1, 1, 1);
            background.Texture  = D3D9Manager.Instance.FindTexture("Background");

            /// <summary>
            /// idInput UI Resource Initialize
            /// </summary>
            idInput = new TextInputField("InputField");

            idInput.Position     = new Vector3(619, 415, 0);
            idInput.FieldTexture = D3D9Manager.Instance.FindTexture("NameInput");
            idInput.MaxLength    = 15;
            idInput.StringColor  = new Color(127, 127, 127);
            idInput.StringOffset = new Vector3(20, 6, 0);

            /// <summary>
            /// passwordInput UI Resource Initialize
            /// </summary>
            passwordInput = new TextInputField("InputField");

            passwordInput.Position     = new Vector3(619, 472, 0);
            passwordInput.FieldTexture = D3D9Manager.Instance.FindTexture("NameInput");
            passwordInput.MaxLength    = 15;
            passwordInput.StringColor  = new Color(127, 127, 127);
            passwordInput.StringOffset = new Vector3(20, 6, 0);
            passwordInput.PasswordChar = '●';

            /// <summary>
            /// loginButton UI Resource Initialize
            /// </summary>
            loginButton = new Button();

            loginButton.ButtonTexture     = D3D9Manager.Instance.FindTexture("LoginButton");
            loginButton.Position          = new Vector3(850, 443, 0);
            loginButton.Scale             = new Vector3(1.0f, 1.0f, 1.0f);
            loginButton.IsMouseOverResize = true;
            loginButton.OnButtonClick    += LoginButton_OnClick;

            /// <summary>
            /// toSignUpButton UI Resource Initialize
            /// </summary>
            toSignUpButton = new Button();

            toSignUpButton.ButtonTexture     = D3D9Manager.Instance.FindTexture("ToSignupButton");
            toSignUpButton.Position          = new Vector3(100, 670, 0);
            toSignUpButton.Scale             = new Vector3(1.0f, 1.0f, 1.0f);
            toSignUpButton.IsMouseOverResize = true;

            toSignUpButton.OnButtonClick += ToSignUpButton_OnClick;


            GameObjectManager.Instance.AddObject(background);
            GameObjectManager.Instance.AddObject(idInput);
            GameObjectManager.Instance.AddObject(passwordInput);
            GameObjectManager.Instance.AddObject(loginButton);
            GameObjectManager.Instance.AddObject(toSignUpButton);

            #endregion
        }
Example #11
0
        private void InitializeComponent()
        {
            #region UI RESOURCE INITIALIZE SOURCE CODE

            /// <summary>
            /// background UI Resource Initialize
            /// </summary>
            background = new TextureObject();

            background.Position = new Vector3(ClientWindow.Width / 2, ClientWindow.Height / 2, 0);
            background.Scale    = new Vector3(1, 1, 1);
            background.Texture  = D3D9Manager.Instance.CreateTexture("Background", "./Resource/Background3.png");

            /// <summary>
            /// roomNameBG UI Resource Initialize
            /// </summary>
            roomNameBG = new TextureObject();

            roomNameBG.Position = new Vector3(320, 56, 0);
            roomNameBG.Scale    = new Vector3(1, 1, 1);
            roomNameBG.Texture  = D3D9Manager.Instance.CreateTexture("RoomNameBG", "./Resource/RoomName.png");

            /// <summary>
            /// roomChangeToggle UI Resource Initialize
            /// </summary>
            roomChangeToggle = new Button();

            roomChangeToggle.ButtonTexture     = D3D9Manager.Instance.CreateTexture("RoomChange", "./Resource/RoomChange.png");
            roomChangeToggle.Position          = new Vector3(1087, 58, 0);
            roomChangeToggle.Scale             = new Vector3(1.0f, 1.0f, 1.0f);
            roomChangeToggle.IsMouseOverResize = true;
            roomChangeToggle.OnButtonClick    += RoomChangeToggle_OnClick;


            /// <summary>
            /// chattingView UI Resource Initialize
            /// </summary>
            chattingView = new TextList("ChatListFont");

            chattingView.TextDepth = 25;
            chattingView.Position  = new Vector3(30, D3D9Manager.Instance.WindowHeight - 160, 0);

            /// <summary>
            /// chattingInput UI Resource Initialize
            /// </summary>
            chattingInput = new TextInputField("ChatInputFont");

            chattingInput.Position     = new Vector3(549, D3D9Manager.Instance.WindowHeight - 100, 0);
            chattingInput.FieldTexture = D3D9Manager.Instance.FindTexture("ChatInput");
            chattingInput.MaxLength    = 60;
            chattingInput.StringColor  = new Color(127, 127, 127);
            chattingInput.StringOffset = new Vector3(16, 3, 0);
            chattingInput.OnEnter     += ChattingInput_OnEnter;

            /// <summary>
            /// roomNameView UI Resource Initialize
            /// </summary>
            roomNameView = new TextBox();

            roomNameView.Position    = new Vector3(50, 20, 0);
            roomNameView.Text        = ClientManager.Instance.CurrentChatRoom;
            roomNameView.StringColor = new Color(255, 255, 255, 255);
            roomNameView.FontKey     = "RoomTitleFont";

            /// <summary>
            /// roomListViewer UI Resource Initialize
            /// </summary>

            roomListViewer = new NetworkRoomListViewer();

            roomListViewer.Position = new Vector3(1087, 300, 0);
            roomListViewer.IsActive = false;

            GameObjectManager.Instance.AddObject(background);
            GameObjectManager.Instance.AddObject(roomNameBG);
            GameObjectManager.Instance.AddObject(chattingView);
            GameObjectManager.Instance.AddObject(chattingInput);
            GameObjectManager.Instance.AddObject(roomChangeToggle);
            GameObjectManager.Instance.AddObject(roomNameView);
            GameObjectManager.Instance.AddObject(roomListViewer);

            #endregion
        }