public override void OnInitializeScene(GameFramework g) { BindGameController(); font_small = g.CANVAS.CreateFont(new System.Drawing.Font("Arial", 12)); font_large = g.CANVAS.CreateFont(new System.Drawing.Font("Arial", 28)); menu = new PanelMenu(font_small, new PanelMenuSelectHandler(MenuHandler)); menu.ForegroundColor = Color.White; menu.BackgroundColor = Color.Black; menu.BorderColor = Color.White; //menu.ScrollButtonWidth = 20; menu.SetHeight(100); menu.SetPosition(200, 200); menu.SetWidth(100); //menu.DrawFormat = DrawTextFormat.None; int height = menu.LayoutMenuOptions(new string[] { "item1", "item2", "item3", "item4", "item5", "item6", "item7", "item8 ", "item9 ", "item10" }, PanelLayout.HorizontalFree); }
public override void OnInitializeScene(GameFramework g) { BindGameController(); _background.X = 0; _background.Y = 0; _background.Width = g.CANVAS.Size.Width; _background.Height = g.CANVAS.Size.Height; //string path = System.Environment.CurrentDirectory + @"\ImageLib.dll"; string path = string.Format(@"\\{0}\DDDClient\ImageLib.dll", DDD_Global.Instance.HostName); ImageLib = Assembly.LoadFile(path); //font_small = g.CANVAS.CreateFont(new System.Drawing.Font("Arial", 12)); font_small = g.CANVAS.CreateFont(new System.Drawing.Font("MS Sans Serif", 14)); font_large = g.CANVAS.CreateFont(new System.Drawing.Font("Arial", 28)); bounding_rect = font_large.MeasureString(null, Message, DrawTextFormat.NoClip, Color.Yellow); bounding_rect.X = (_background.Width - bounding_rect.Width) / 2; bounding_rect.Y = (int)(_background.Height - (2 * bounding_rect.Height)); player_rect.X = (int)((_background.Width - (_background.Width / 4)) / 2); player_rect.Y = (int)((_background.Height - (_background.Height / 3)) / 2); player_rect.Width = (int)(_background.Width / 4); player_rect.Height = (int)(_background.Height / 3); _player_window = CreateWindow(g.CANVAS.CreateFont(new System.Drawing.Font("MS Sans Serif", 12)), "Available Players", player_rect.X, player_rect.Y, player_rect.Right, player_rect.Bottom); _player_window.AllowMove = false; _player_window.AllowShade = false; _player_window.AllowResize = false; _player_window.HasScrollBars = false; _player_menu = new PanelMenu( g.CANVAS.CreateFont(new System.Drawing.Font("MS Sans Serif", 14)), new PanelMenuSelectHandler(PlayerSelection) ); _player_menu.BackgroundColor = Color.Black; _player_window.BindPanelControl(_player_menu); _player_window.Show(); _player_menu.LayoutMenuOptions(new string[] { "Populating ..." }, PanelLayout.Vertical); _continue_btn = (PanelStaticButton) new PanelStaticButton(_player_window.ClientArea.Left, _player_window.ClientArea.Bottom + 2, _player_window.ClientArea.Right, _player_window.ClientArea.Bottom + 27); _continue_btn.Text = "Continue"; _continue_btn.BackgroundColor = Color.FromArgb(204, 63, 63, 63); _continue_btn.BorderColor = Color.White; _continue_btn.Font = font_small; _continue_btn.MouseClick = new System.Windows.Forms.MouseEventHandler(this.Btn_Continue); }
public void HandshakeAvailablePlayers(string[] players) { _player_window.Resize(_player_window.ClientArea.Width, _player_menu.LayoutMenuOptions(players, PanelLayout.Vertical)); _continue_btn.SetClientArea(_player_window.ClientArea.Left, _player_window.ClientArea.Bottom + 2, _player_window.ClientArea.Right, _player_window.ClientArea.Bottom + 27); }
public override void OnInitializeScene(GameFramework g) { BindGameController(); _background.X = 0; _background.Y = 0; _background.Width = g.CANVAS.Size.Width; _background.Height = g.CANVAS.Size.Height; //string path = System.Environment.CurrentDirectory + @"\ImageLib.dll"; string path = string.Format(@"\\{0}\DDDClient\ImageLib.dll", DDD_Global.Instance.HostName); ImageLib = Assembly.LoadFile(path); //font_small = g.CANVAS.CreateFont(new System.Drawing.Font("Arial", 12)); font_small = g.CANVAS.CreateFont(new System.Drawing.Font("MS Sans Serif", 14)); font_large = g.CANVAS.CreateFont(new System.Drawing.Font("Arial", 28)); bounding_rect = font_large.MeasureString(null, Message, DrawTextFormat.NoClip, Color.Yellow); bounding_rect.X = (_background.Width - bounding_rect.Width) / 2; bounding_rect.Y = (int)(_background.Height - (2*bounding_rect.Height)); player_rect.X = (int)((_background.Width - (_background.Width / 4)) / 2); player_rect.Y = (int)((_background.Height - (_background.Height / 3)) / 2); player_rect.Width = (int)(_background.Width / 4); player_rect.Height = (int)( _background.Height / 3); _player_window = CreateWindow(g.CANVAS.CreateFont(new System.Drawing.Font("MS Sans Serif", 12)), "Available Players", player_rect.X, player_rect.Y, player_rect.Right , player_rect.Bottom); _player_window.AllowMove = false; _player_window.AllowShade = false; _player_window.AllowResize = false; _player_window.HasScrollBars = false; _player_menu = new PanelMenu( g.CANVAS.CreateFont(new System.Drawing.Font("MS Sans Serif", 14)), new PanelMenuSelectHandler(PlayerSelection) ); _player_menu.BackgroundColor = Color.Black; _player_window.BindPanelControl(_player_menu); _player_window.Show(); _player_menu.LayoutMenuOptions(new string[] { "Populating ..." }, PanelLayout.Vertical); _continue_btn = (PanelStaticButton)new PanelStaticButton(_player_window.ClientArea.Left, _player_window.ClientArea.Bottom + 2, _player_window.ClientArea.Right, _player_window.ClientArea.Bottom + 27); _continue_btn.Text = "Continue"; _continue_btn.BackgroundColor = Color.FromArgb(204, 63, 63, 63); _continue_btn.BorderColor = Color.White; _continue_btn.Font = font_small; _continue_btn.MouseClick = new System.Windows.Forms.MouseEventHandler(this.Btn_Continue); }