public override void Initialize() { this.Window.Title = "战舰少女 Remix"; isNightMode = true; FileStream harborbg; if(isNightMode) harborbg = new FileStream(@"Content\dark_harbor.png", FileMode.Open, FileAccess.Read); else harborbg = new FileStream(@"Content\day_harbor.png", FileMode.Open, FileAccess.Read); _msgfont = new Font("msyh.ttc", 20) { EnableBorder = true, BorderColor = Color.Black }; harbor = new Harbor() { Texture = Texture2D.FromStream(GraphicsDevice, harborbg), }; factory = new Factory() { Texture = Sprite.CreateTextureFromFile(@"Content\factbg.png"), }; this.KeyDown += Game1_KeyDown; select = new MapSelect(); Scenes.Add("Harbor", harbor); Scenes.Add("Factory", factory); Scenes.Add("Select", select); base.Initialize(); Scenes.Navigate("Harbor"); }
public TabBar(Font fnt,Font noshadow) { _fnt = fnt; _fntnoshadow = noshadow; }
public override void Initialize() { fnt = new Font("msyh.ttc", 25); fntsmall = new Font("msyh.ttc", 15); fntborder = new Font("msyh.ttc", 15) { EnableBorder = true, BorderColor = Color.Black }; spm = new ScrollPanel() { Margin = Origins.TopRight, Width = 1000, Height = GraphicsDevice.Viewport.Height - 80, Top = 80, Right = 0 }; b = new Button() { Bottom = 10, Left = 195, Width = 165, Height = 40, Margin = Origins.BottomLeft, }; breturn = new Button() { Bottom = 10, Left = 10, Width = 165, Height = 40, Margin = Origins.BottomLeft }; combob = new ComboBox() { Top = 120, Left = 10, Width = 350, Margin = Origins.TopLeft, }; groupcb = new ComboBox() { Top = 10, Right = 300, Width = 200, Margin = Origins.TopRight, FocusColor = Color.CornflowerBlue, }; sortcb = new ComboBox() { Top = 10, Right = 20, Width = 200, Margin = Origins.TopRight, FocusColor = Color.LightGreen, }; tb = new TabControl() { Top = 54, Right = 10, Margin = Origins.TopRight, Width = GraphicsDevice.Viewport.Width, Height = GraphicsDevice.Viewport.Height, TabMargin = Origins.TopRight }; bg = Sprite.CreateTextureFromFile(@"Content\menu-background-xmas-6.png"); menu_osu = Sprite.CreateTextureFromFile(@"Content\010c0951.png"); top = Sprite.CreateTextureFromFile(@"Content\songselect-top.png"); Controls.Add(spm); Controls.Add(b); Controls.Add(breturn); Controls.Add(tb); Controls.Add(combob); Controls.Add(groupcb); Controls.Add(sortcb); base.Initialize(); CreateMap(); p_Click((object)maps[0], null); spm.Controls.AddRange(maps.ToArray()); spm.ScrollSpeed = 150; b.Text = "开始颓废"; breturn.Text = "返回母港"; breturn.Click += Breturn_Click; combob.AddItem("地图信息"); combob.AddItem("本地排行"); combob.AddItem("在线排行"); combob.AddItem("好友排行"); combob.SelectedItem = "地图信息"; groupcb.AddItem("不分组"); groupcb.AddItem("作者"); groupcb.AddItem("添加日期"); groupcb.AddItem("长度"); groupcb.AddItem("海域"); groupcb.AddItem("地图名称"); groupcb.AddItem("收藏夹"); groupcb.AddItem("我做的图"); groupcb.AddItem("最近玩过的"); groupcb.SelectedItem = "不分组"; sortcb.AddItem("海域编号"); sortcb.AddItem("地图名称"); sortcb.AddItem("作者"); sortcb.AddItem("长度"); sortcb.AddItem("添加日期"); sortcb.SelectedItem = "海域编号"; tb.AddTab(Control.Empty, "不分组"); tb.AddTab(Control.Empty, "作者"); tb.AddTab(Control.Empty, "最近玩过的"); tb.AddTab(Control.Empty, "收藏夹"); tb.SwitchTab(0); this.Show += MapSelect_Show; this.Leave += MapSelect_Leave; }
public override void Initialize() { this.Texture = Sprite.CreateTextureFromFile(@"Content\menu-button-background.png"); this.Width = Texture.Width; this.Height = Texture.Height; TextFont = new Font(DefaultFontFileName, 20); TextFontsm = new Font(DefaultFontFileName, 15); SeaTitle = new Label() { Font = TextFont, Color = Color.Black, Left = 163, Top = 9, }; CreatorInfo = new Label() { Font = TextFontsm, Color = Color.Black, Left = 163, Top = 32, }; MapTitle = new Label() { Font = TextFontsm, Color = Color.Black, Left = 163, Top = 50, }; float scale = (float)1.0 * 85 / 298; MapSprite = new Control() { Texture=Sprite.CreateTextureFromFile(Map.PreviewImagePath), Width = (int)(530 * scale), Height = (int)(298 * scale) + 1, Margin = Origins.CenterLeft, Left = 8, Color = Color.White, }; Controls.Add(SeaTitle); Controls.Add(CreatorInfo); Controls.Add(MapTitle); Controls.Add(MapSprite); base.Initialize(); SeaTitle.Text = Map.MapName; CreatorInfo.Text = Map.Creator; MapTitle.Text = Map.Title; }
public override void Initialize() { bigger = new Font(DefaultFontFileName, 20) { EnableShadow = true, ShadowColor = Color.Black, ShadowXOffset = 0, ShadowYOffset = 1 }; normal = new Font(DefaultFontFileName, 12) { EnableBorder=true, BorderColor=Color.Black, }; smaller = new Font(DefaultFontFileName, 15) { EnableShadow = true, ShadowColor=Color.Black, ShadowXOffset=0, ShadowYOffset=1 }; fpsvalue = new Label() { Color = Color.White, Margin = Origins.BottomRight, Bottom = 2, Right = 2, Font = normal }; Controls.Add(fpsvalue); base.Initialize(); }