Example #1
0
        public HostScreen(GraphicsDeviceManager graphics, ContentManager Content, SivEventHandler theEvent, Game1 parent)
            : base("HostScreen", theEvent, parent)
        {
            #region Load Resource
            font = Content.Load <SpriteFont>("Resource/font/TNRoman_12_Bold");
            bg   = new Background(Content.Load <Texture2D>("Resource/background"), this);
            #endregion

            #region Image
            saber = new Image("saber2", Content.Load <Texture2D>("Resource/saber_trans")
                              , new RectangleF(-50, 0, 700, 735), 0.99f, this);
            dialog = new Image("dialog", Content.Load <Texture2D>("Resource/dialog_menu")
                               , new RectangleF(400, 120, 400, 300), 0.98f, this);
            #endregion

            #region Host Game Panel
            ipTextBox = new TextBox("Hosting IP", Game1.whiteTextbox, Game1.highlightedTextbox, Game1.caret
                                    , font, new RectangleF(470, 160, 250, 20), this);
            ipTextBox.Text = "255.255.255.255";

            Host_name_label = new Label("host_name_label",
                                        font, "Player name"
                                        , 470, 200, 150, Color.White, this);

            Host_name_textbox = new TextBox("Host_name_textbox"
                                            , Game1.whiteTextbox, Game1.highlightedTextbox, Game1.caret
                                            , font, new RectangleF(620, 200, 100, 20), this);
            Host_name_textbox.Text = "AltimaZ";

            Room_name_label = new Label("Room_name_label"
                                        , font, "Room name"
                                        , 470, 230, 150, Color.White, this);

            Room_name_textbox = new TextBox("Room_name_textbox"
                                            , Game1.whiteTextbox, Game1.highlightedTextbox, Game1.caret
                                            , font, new RectangleF(620, 230, 100, 20), this);
            Room_name_textbox.Text = "Room Test";

            Number_of_player_label = new Label("Number_of_player_label"
                                               , font, "Number of Player"
                                               , 470, 260, 150, Color.White, this);

            Number_of_player_textbox = new TextBox("Number_of_player_textbox"
                                                   , Game1.whiteTextbox, Game1.highlightedTextbox, Game1.caret
                                                   , font, new RectangleF(620, 260, 100, 20), this);
            Number_of_player_textbox.Text = "3";

            OK_button = new ImageButton("OK_button"
                                        , Content.Load <Texture2D>("Resource/button/ok_button")
                                        , new RectangleF(480, 300, 120, 42), this);
            OK_button.OnClick += Ok_button_clicked;

            Canel_button = new ImageButton("Cancel_button"
                                           , Content.Load <Texture2D>("Resource/button/back_button")
                                           , new RectangleF(600, 300, 120, 42), this);
            Canel_button.OnClick += Cancel_button_clicked;
            #endregion

            List <string> ls = new List <string>();
            ls.Add("Sakuraba Neku");
            ls.Add("Yayyyyy");
            ls.Add("I'm so powerful");
            ls.Add("Sakuraba Neku");
            ls.Add("Yayyyyy");
            ls.Add("I'm so powerful");
            ls.Add("Sakuraba Neku");
            ls.Add("Yayyyyy");
            ls.Add("I'm so powerful");
            ls.Add("Sakuraba Neku");
            ls.Add("Yayyyyy");
            ls.Add("I'm so powerful");
            test_menu = new Menu("test_menu", font, ls, this);
            test_menu.MenuItemSelected += Test_Menu_Item_Selected;

            #region HostScreen_RegisterHandler
            OnKeysDown        += HostScreen_OnKeysDown;
            OnRightMouseClick += HostScreen_OnRightMouseClick;
            #endregion
        }
Example #2
0
        public RoomScreen(GraphicsDeviceManager graphics, ContentManager Content, SivEventHandler theEvent, Game1 parent)
            : base("RoomScreen", theEvent, parent)
        {
            #region Load Resource
            avatarDefault      = Content.Load <Texture2D>("Resource/avatar_default");
            backGround         = new Background(Content.Load <Texture2D>("Resource/background"), this);
            imageBorderTexture = Content.Load <Texture2D>("Resource/graphic/base2");
            #endregion

            #region Player Content
            div_char[0] = new RectangleF(55, 40, 180, 180);
            div_char[1] = new RectangleF(265, 40, 180, 180);
            div_char[2] = new RectangleF(475, 40, 180, 180);
            div_char[3] = new RectangleF(685, 40, 180, 180);
            div_char[4] = new RectangleF(55, 270, 180, 180);
            div_char[5] = new RectangleF(265, 270, 180, 180);
            div_char[6] = new RectangleF(475, 270, 180, 180);
            div_char[7] = new RectangleF(685, 270, 180, 180);

            //div_border = new Border("player_border", borderColor, 2
            //   , new RectangleF(20, 20, 900, 480), this);
            //Image playerPanel = new Image("Player Panel", panelTexture, new RectangleF(10, 10, 920, 500), 0.3f, this);
            Panel playerPanel = new Panel(new RectangleF(10, 10, 920, 500), this);
            #endregion

            #region Room Information
            //div_info_border = new Border("div_info", borderColor, 2
            //    , new RectangleF(930, 20, 250, 480), this);
            //roomInfoDiv =Image info_pane new Div("Room Info", new RectangleF(932, 22, 246, 476), Color.DarkRed, this);
            //Image infoPanel = new Image("Info Panel", Game1.panelTexture, new RectangleF(932, 22, 246, 476), 0.3f, this);
            Panel infoPanel = new Panel(new RectangleF(932, 22, 246, 476), this);
            roomInfoContent = new Label("Room Info", Game1.gautami12Regular, "", 960, 80, 300, Color.White, this);
            roomInfoTitle   = new Label("Info Label", Game1.gautami14Bold, "Room Information", 970, 50, 300, Color.White, this);
            #endregion

            #region Player Name Label
            for (int i = 0; i < div_char.Length; i++)
            {
                //String name = "div_char" + i;
                //div_char_border[i] = new Border(name, borderColor, 2, div_char[i], this);
                if (i < 4)
                {
                    playerName[i] = new Label("playerNameLabel" + i, Game1.arial12Bold, ""
                                              , 55 + (i * 210), 230, 180, Color.White, this);
                    playerName[i].CenterAlign = true;
                }
                else
                {
                    playerName[i] = new Label("playerNameLabel" + i, Game1.arial12Bold, ""
                                              , 55 + ((i - 4) * 210), 460, 180, Color.White, this);
                    playerName[i].CenterAlign = true;
                }
            }
            MainPlayer_Boder = new Border("MainPlayer_Border", Color.Purple, 2, new RectangleF(0, 0, 0, 0), this);
            #endregion

            #region Button
            cancelButtonTexture = Content.Load <Texture2D>("Resource/button/cancel_button");
            readyButtonTexture  = Content.Load <Texture2D>("Resource/button/ready");
            startButtonTexture  = Content.Load <Texture2D>("Resource/button/start_button");

            start_button = new ImageButton("Start", startButtonTexture
                                           , new RectangleF(980, 540, 180, 70), this);
            start_button.OnClick += Start_button_clicked;

            quit_button = new ImageButton("Quit", Content.Load <Texture2D>("Resource/button/quit_button")
                                          , new RectangleF(980, 620, 180, 70), this);
            quit_button.OnClick += Quit_button_clicked;
            #endregion

            #region Chat
            //Textbox
            chat = new TextBox("Chat Input"
                               , Game1.whiteTextbox, Game1.highlightedTextbox, Game1.caret
                               , Game1.font, new RectangleF(22, 662, 946, 20), this);
            chat.OnEnterPressed += ChatBox_EnterPressed;

            chatDisplay = new TextBox("Chat Display"
                                      , Game1.transparentTextBox, Game1.highlightedTextbox, Game1.caret
                                      , Game1.scrollbarBackground, Game1.scrollbar
                                      , Game1.font, new RectangleF(22, 522, 946, 126), this);
            chatDisplay.Color       = Color.White;
            chatDisplay.ReadOnly    = true;
            chatDisplay.vscrollable = true;

            //Border
            chat_box_border   = new Border("chat_screen", Color.White, 2, chatDisplay.Rect, this);
            chat_input_border = new Border("chat_input", Color.White, 2, chat.Rect, this);
            #endregion

            #region RoomScreen_RegisterHandler
            OnKeysDown += RoomScreen_OnKeysDown;
            #endregion
        }