Esempio n. 1
0
        public void SameAsWait()
        {
            FocusTextBox           = WaitTextBox.GetClone();
            FocusTextBox.FontColor = Color.CornflowerBlue;
            DownTextBox            = WaitTextBox.GetClone();
            DownTextBox.FontColor  = Color.Yellow;
            UpTextBox = WaitTextBox.GetClone();

            FocusTextureBox = WaitTextureBox.GetClone();
            DownTextureBox  = WaitTextureBox.GetClone();
            UpTextureBox    = WaitTextureBox.GetClone();
        }
Esempio n. 2
0
 public FormBox(Game g)
     : base(g)
 {
     BGTextureBox = new TextureBox(g);
     ControlBoxes.Add(BGTextureBox);
     OnFormBoxAppear    = new FormBoxEvent(OnFormBoxAppearCode);
     OnFormBoxDisappear = new FormBoxEvent(OnFormBoxDisappearCode);
     OnFormBoxFocus     = new FormBoxEvent(OnFormBoxFocusCode);
     OnFormBoxLostFocus = new FormBoxEvent(OnFormBoxLostFocusCode);
     OnKeyDown          = new KeyboardEvent(OnKeyDownCode);
     OnKeyUp            = new KeyboardEvent(OnKeyUpCode);
     OnKeyDownHold      = new KeyboardEvent(OnKeyDownHoldCode);
 }
Esempio n. 3
0
        //void HideAll()
        //{
        //    WaitTextureBox.Visible = FocusTextureBox.Visible = DownTextureBox.Visible = UpTextureBox.Visible = false;
        //}
        ///// <summary>
        ///// 转换到等待状态
        ///// </summary>
        //public void Wait()
        //{
        //    HideAll();
        //    WaitTextureBox.Visible = true;
        //}
        ///// <summary>
        ///// 转换到选中状态
        ///// </summary>
        //public void Focus()
        //{
        //    HideAll();
        //    FocusTextureBox.Visible = true;
        //}
        ///// <summary>
        ///// 转换到按下状态
        ///// </summary>
        //public void Down()
        //{
        //    HideAll();
        //    DownTextureBox.Visible = true;
        //}
        ///// <summary>
        ///// 转换到抬起状态
        ///// </summary>
        //public void Up()
        //{
        //    HideAll();
        //    UpTextureBox.Visible = true;
        //}

        public ButtonBox(Game g)
            : base(g)
        {
            WaitTextureBox  = new TextureBox(g);
            UpTextureBox    = new TextureBox(g);
            DownTextureBox  = new TextureBox(g);
            FocusTextureBox = new TextureBox(g);
            WaitTextBox     = new TextBox(g);
            UpTextBox       = new TextBox(g);
            DownTextBox     = new TextBox(g);
            FocusTextBox    = new TextBox(g);
            OnButtonWait    = new ButtonBoxEvent(OnButtonWaitCode);
            OnButtonFocus   = new ButtonBoxEvent(OnButtonFocusCode);
            OnButtonDown    = new ButtonBoxEvent(OnButtonDownCode);
            OnButtonUp      = new ButtonBoxEvent(OnButtonUpCode);

            Visible = true;
        }
Esempio n. 4
0
        //void HideAll()
        //{
        //    WaitTextureBox.Visible = FocusTextureBox.Visible = DownTextureBox.Visible = UpTextureBox.Visible = false;
        //}
        ///// <summary>
        ///// 转换到等待状态
        ///// </summary>
        //public void Wait()
        //{
        //    HideAll();
        //    WaitTextureBox.Visible = true;
        //}
        ///// <summary>
        ///// 转换到选中状态
        ///// </summary>
        //public void Focus()
        //{
        //    HideAll();
        //    FocusTextureBox.Visible = true;
        //}
        ///// <summary>
        ///// 转换到按下状态
        ///// </summary>
        //public void Down()
        //{
        //    HideAll();
        //    DownTextureBox.Visible = true;
        //}
        ///// <summary>
        ///// 转换到抬起状态
        ///// </summary>
        //public void Up()
        //{
        //    HideAll();
        //    UpTextureBox.Visible = true;
        //}
        public ButtonBox(Game g)
            : base(g)
        {
            WaitTextureBox = new TextureBox(g);
            UpTextureBox = new TextureBox(g);
            DownTextureBox = new TextureBox(g);
            FocusTextureBox = new TextureBox(g);
            WaitTextBox = new TextBox(g);
            UpTextBox = new TextBox(g);
            DownTextBox = new TextBox(g);
            FocusTextBox = new TextBox(g);
            OnButtonWait = new ButtonBoxEvent(OnButtonWaitCode);
            OnButtonFocus = new ButtonBoxEvent(OnButtonFocusCode);
            OnButtonDown = new ButtonBoxEvent(OnButtonDownCode);
            OnButtonUp = new ButtonBoxEvent(OnButtonUpCode);

            Visible = true;
        }
Esempio n. 5
0
        void drawTextureBox(TextureBox tb,Point basepos)
        {
            basepos = Util.PointAddPoint(basepos, tb.Location);
            basepos = Util.PointAddPoint(basepos, ScreenOffsetPixelPoint);
            Color fColor = ColorFilter;

            fColor = Util.MixColor(fColor, tb.TextureFliterColor);
            //if (tb.Texture.Index > -1)
            //{
            //    game.DrawMetalXTexture(game.Textures[tb.Texture.Index], new System.Drawing.Rectangle(new System.Drawing.Point(), game.Textures[tb.Texture.Index].Size), basepos, tb.Size,0, fColor);
            //}
            //else
            {
                int j = game.Textures.GetIndex(tb.Texture.Name);
                if (j < 0)
                {
                    return;
                }
                //tb.Texture.Index = j;
                game.DrawMetalXTexture(game.Textures[j], new System.Drawing.Rectangle(new System.Drawing.Point(), game.Textures[j].Size), basepos, tb.Size,0, fColor);
            }
        }
Esempio n. 6
0
 public FormBox(Game g)
     : base(g)
 {
     BGTextureBox = new TextureBox(g);
     ControlBoxes.Add(BGTextureBox);
     OnFormBoxAppear = new FormBoxEvent(OnFormBoxAppearCode);
     OnFormBoxDisappear = new FormBoxEvent(OnFormBoxDisappearCode);
     OnFormBoxFocus = new FormBoxEvent(OnFormBoxFocusCode);
     OnFormBoxLostFocus = new FormBoxEvent(OnFormBoxLostFocusCode);
     OnKeyDown = new KeyboardEvent(OnKeyDownCode);
     OnKeyUp = new KeyboardEvent(OnKeyUpCode);
     OnKeyDownHold = new KeyboardEvent(OnKeyDownHoldCode);
 }
Esempio n. 7
0
        public void SameAsWait()
        {
            FocusTextBox = WaitTextBox.GetClone();
            FocusTextBox.FontColor = Color.CornflowerBlue;
            DownTextBox = WaitTextBox.GetClone();
            DownTextBox.FontColor = Color.Yellow;
            UpTextBox = WaitTextBox.GetClone();

            FocusTextureBox = WaitTextureBox.GetClone();
            DownTextureBox = WaitTextureBox.GetClone();
            UpTextureBox = WaitTextureBox.GetClone();
        }
Esempio n. 8
0
        public MenuCHR(Game g)
            : base(g)
        {
            Name = "MenuCHR";
            Location = new Point(0, 0);

            BGTextureBox.Texture.Name = "bg_160x240";
            BGTextureBox.TextureFliterColor = Color.FromArgb(150, 0xff, 0xff, 0xff);
            BGTextureBox.Size = new Size(320, 480);

            int line = 5;

            head = new TextureBox(g);
            head.Location = new Point(32, 16);
            head.Size = new Size(96, 96);

            nam = new TextBox(g);
            nam.Location = new Point(24, line++ * 24 - 4);

            exp = new TextBox(g);
            exp.Location = new Point(24, line++ * 24 - 4);

            lv = new TextBox(g);
            lv.Location = new Point(24, line++ * 24);

            hp = new TextBox(g);
            hp.Location = new Point(24, line++ * 24);

            itl = new TextBox(g);
            itl.Location = new Point(24, line++ * 24);

            str = new TextBox(g);
            str.Location = new Point(24, line++ * 24);

            agi = new TextBox(g);
            agi.Location = new Point(24, line++ * 24);

            phy = new TextBox(g);
            phy.Location = new Point(24, line++ * 24);

            mtllv = new TextBox(g);
            mtllv.Location = new Point(24, line++ * 24 + 4);

            chrlv = new TextBox(g);
            chrlv.Location = new Point(24, line++ * 24 + 4);

            line = 0;

            dmg = new TextBox(g);
            dmg.Location = new Point(160, (++line) * 24);

            //b_weapon = new ButtonBox(g);
            //b_weapon.Location = new Point(224, line++ * 32);
            //b_weapon.OnButtonFocus += new ButtonBoxEvent(MenuCHR_OnButtonFocus);
            //b_weapon.OnButtonUp += new ButtonBoxEvent(MenuCHR_OnButtonUp);

            def = new TextBox(g);
            def.Location = new Point(160, (line+=2) * 24);

            ControlBoxes.Add(head);
            ControlBoxes.Add(nam);
            ControlBoxes.Add(lv);
            ControlBoxes.Add(hp);

            ControlBoxes.Add(dmg);
            ControlBoxes.Add(def);

            ControlBoxes.Add(str);
            ControlBoxes.Add(agi);
            ControlBoxes.Add(itl);
            ControlBoxes.Add(phy);

            ControlBoxes.Add(chrlv);
            ControlBoxes.Add(mtllv);

            ControlBoxes.Add(exp);

            //ControlBoxes.Add(b_weapon);
            line = 5;

            b_equip = new List<ButtonBox>();
            for (int i = 0; i < 8; i++)
            {
                b_equip.Add(new ButtonBox(g));
                b_equip[i].OnButtonFocus += new ButtonBoxEvent(MenuCHR_OnButtonFocus);
                b_equip[i].OnButtonUp += new ButtonBoxEvent(MenuCHR_OnButtonUp);
                b_equip[i].Location = new Point(144, line * 24 + i * 24);
                ControlBoxes.Add(b_equip[i]);
            }

            this.OnFormBoxAppear += new FormBoxEvent(MenuCHR_OnFormBoxAppear);
            this.OnFormBoxDisappear += new FormBoxEvent(MenuCHR_OnFormBoxDisappear);
        }