public ASKboolBox(Game g) : base(g) { Name = "ASKboolBox"; Location = new Point(0, 360); TextBox = new TextBox(g); TextBox.Location = new Point(16, 16); TextBox.OneByOne = true; BB1 = new ButtonBox(g); BB1.Location = new Point(300, 80); BB1.UpTextBox.Text = BB1.DownTextBox.Text = BB1.FocusTextBox.Text = BB1.WaitTextBox.Text = "是"; BB1.FocusTextBox.FontColor = Color.Blue; BB1.OnButtonDown += new ButtonBoxEvent(BB1_OnButtonDown); BB2 = new ButtonBox(g); BB2.Location = new Point(400, 80); BB2.UpTextBox.Text = BB2.DownTextBox.Text = BB2.FocusTextBox.Text = BB2.WaitTextBox.Text = "否"; BB2.FocusTextBox.FontColor = Color.Blue; BB2.OnButtonDown += new ButtonBoxEvent(BB2_OnButtonDown); ControlBoxes.Add(TextBox); ControlBoxes.Add(BB1); ControlBoxes.Add(BB2); }
//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; }
public LogoGame(Game g) : base(g) { Name = "LogoGame"; Location = new Point(0, 400); //Size = new Size(640, 120); //BGTextureName = "bg-256x64"; TextBox tb1 = new TextBox(g); tb1.Location = new Point(16, 16); tb1.Text = "MetalHunter!"; tb1.FontName = "Consolas"; tb1.FontSize = 36; tb1.Interval = 200; tb1.OneByOne = true; ControlBoxes.Add(tb1); }
public MenuBAG(Game g) : base(g) { //BigStep = 8; Name = "MenuBAG"; Location = new Point(320, 0); BGTextureBox.Texture.Name = "bg_160x240"; BGTextureBox.Size = new Size(320, 480); for (int i = 0; i < 16; i++) { bb.Add(new ButtonBox(game)); } tb = new TextBox(g); //tb.OneByOne = true; //tb.Interval = 10; tb.Location = new Point(184, 24); this.OnFormBoxDisappear += new FormBoxEvent(MenuBAG_OnFormBoxDisappear); this.OnFormBoxAppear += new FormBoxEvent(MenuBAG_OnFormBoxAppear); }
void drawTextBox(TextBox tb, Point basepos) { basepos = Util.PointAddPoint(basepos, tb.Location); basepos = Util.PointAddPoint(basepos, ScreenOffsetPixelPoint); Color fColor = Util.MixColor(ColorFilter, tb.FontColor); if (tb.OneByOne) { game.DrawText(tb.SubText, basepos, tb.FontName, tb.FontSize, fColor); } else { game.DrawText(tb.Text, basepos, tb.FontName, tb.FontSize, fColor); } }
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(); }
public MSGBox(Game g) : base(g) { Name = "MessageBox"; Location = new Point(64, 480 - 128 - 8); TextBox = new TextBox(g); TextBox.Location = new Point(20, 20); TextBox.OneByOne = true; ControlBoxes.Add(TextBox); }
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); }