//DRAW public void Draw(SpriteBatch spriteBatch) { spriteBatch.Draw(m_background, new Vector2(0, 0), Color.White); spriteBatch.Draw(m_logo, new Vector2(16, 127), Color.White); m_restartButton.Draw(spriteBatch); m_exitButton.Draw(spriteBatch); }
public override void Draw() { Rectangle?sourceRectangle = null; /* * CacheManager.Draw(this.FirstDigitUpperArrowDisplayTexture, this.FirstDigitUpperArrowDisplayPosition, sourceRectangle, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0.099f); * sourceRectangle = null; * CacheManager.Draw(this.FirstDigitLowerArrowDisplayTexture, this.FirstDigitLowerArrowDisplayPosition, sourceRectangle, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0.099f); * sourceRectangle = null; * CacheManager.Draw(this.SecondDigitUpperArrowDisplayTexture, this.SecondDigitUpperArrowDisplayPosition, sourceRectangle, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0.099f); * sourceRectangle = null; * CacheManager.Draw(this.SecondDigitLowerArrowDisplayTexture, this.SecondDigitLowerArrowDisplayPosition, sourceRectangle, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0.099f); * sourceRectangle = null; */ var first = ((this.DaysToGo / 10) % 10).ToString(); var pos = new Vector2(this.DaysToGoFirstDigitTextDisplayPosition.X, this.DaysToGoFirstDigitTextDisplayPosition.Y); var scale = 1f; //DaysToGoTextBuilder.Scale //CacheManager.DrawString(Session.Current.Font, first, pos, Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 0.0999f); //CacheManager.Draw(this.DaysToGoFirstDigitTextTexture, this.DaysToGoFirstDigitTextDisplayPosition, sourceRectangle, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0.0999f); sourceRectangle = null; int num = this.DaysToGo % 10; //num.ToString() pos = new Vector2(this.DaysToGoSecondDigitTextDisplayPosition.X, this.DaysToGoSecondDigitTextDisplayPosition.Y); scale = 1f; //DaysToGoTextBuilder.Scale //CacheManager.DrawString(Session.Current.Font, num.ToString(), pos, Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 0.0999f); //CacheManager.Draw(this.DaysToGoSecondDigitTextTexture, this.DaysToGoSecondDigitTextDisplayPosition, sourceRectangle, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0.0999f); sourceRectangle = null; CacheManager.Draw(this.PlayDisplayTexture, this.PlayDisplayPosition, sourceRectangle, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0.099f); sourceRectangle = null; CacheManager.Draw(this.StopDisplayTexture, this.StopDisplayPosition, sourceRectangle, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0.099f); var left = this.DaysLeftString(); pos = new Vector2(this.DaysLeftTextDisplayPosition.X, this.DaysLeftTextDisplayPosition.Y); scale = 1f; //DaysLeftTextBuilder.Scale CacheManager.DrawString(Session.Current.Font, left, pos, Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 0.0999f); //CacheManager.Draw(this.DaysLeftTextTexture, this.DaysLeftTextDisplayPosition, null, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0.0999f); CacheManager.DrawString(Session.Current.Font, first + num.ToString(), pos + new Vector2(28, 0), Color.Yellow, 0f, Vector2.Zero, scale, SpriteEffects.None, 0.08f); btChangeDays.Draw(); }
public void Draw() { if (btBack.Visible) { //throw new Exception("SaveGame"); btBack.Draw(); } else { } }
public void Draw(GameTime gameTime) { if (Mode == "Start") { CacheManager.DrawAvatar(@"Content/Textures/Resources/Start/LoadingBack.jpg", Vector2.Zero, Color.White * 1f, 1f); if (maps.Length > 0) { var map = maps[page - 1]; if (String.IsNullOrEmpty(map)) { } else { //@"Content/Textures/Resources/ScenarioLoading/Maps/" + Scenario CacheManager.DrawAvatar(map, new Vector2(23 + 66, 5 + 44), Color.White * 1f, new Vector2(1106f / 2821f, 565f / 1587f)); } } CacheManager.DrawAvatar(@"Content/Textures/Resources/Start/LoadingBorder.png", new Vector2(23, 5), Color.White * 1f, 1f); btPre.Draw(); btPlay.Draw(); btPause.Draw(); btNext.Draw(); btLoad.Draw(); btStart.Draw(); if (Platform.PlatFormType == PlatFormType.Win || Platform.PlatFormType == PlatFormType.Desktop || Platform.PlatFormType == PlatFormType.UWP && !Platform.IsMobile) { CacheManager.DrawAvatar(@"Content\Textures\Resources\MouseArrow\Normal.png", InputManager.Position, Color.White, 1f); } } else { CacheManager.DrawAvatar(background, Vector2.Zero, Color.White * 1f, backgroundScale); CacheManager.DrawAvatar(@"Content/Textures/Resources/ScenarioLoading/jindulan.png", new Vector2(215, 650), Color.White * 1f, 1f); CacheManager.DrawString(Session.Current.Font, tishi.Trim(), new Vector2(215 + textPre, 650) + new Vector2(10, 10), Color.White, 0f, Vector2.Zero, 0.8f, SpriteEffects.None, 0f); } }
public void Draw(GameTime gameTime) { float alpha = menuTypeElapsed <= 0.5f ? menuTypeElapsed * 2 : 1f; CacheManager.DrawAvatar(@"Content\Textures\Resources\Start\Start.jpg", Vector2.Zero, Color.White, 1f); if (MenuType == MenuType.None) { btList.ForEach(bt => bt.Draw()); for (int i = 0; i < texts.Length && i <= textLevel; i++) { var text = String.Join(System.Environment.NewLine, texts[i].ToArray()); CacheManager.DrawString(Session.Current.Font, text, new Vector2(720 - 65 * i, 230), Color.White, 0f, Vector2.Zero, 1.5f, SpriteEffects.None, 0f); } } else if (MenuType == MenuType.New) { CacheManager.DrawAvatar(@"Content\Textures\Resources\Start\Scenario.jpg", Vector2.Zero, Color.White * alpha, 1f); CacheManager.DrawString(Session.Current.Font, "剧本选择", new Vector2(38, 27), PlatformColor.DarkRed * alpha); CacheManager.DrawString(Session.Current.Font, "剧本介绍", new Vector2(38, 408), PlatformColor.DarkRed * alpha); CacheManager.DrawString(Session.Current.Font, "势力选择", new Vector2(728, 27), PlatformColor.DarkRed * alpha); btScenarioList.ForEach(bt => bt.Draw(null, Color.White * alpha)); btScenarioSelectListPaged.ForEach(bt => { int index = btScenarioSelectList.IndexOf(bt); if (index >= 0) { var sce = ScenarioList[index]; if (sce != null && !String.IsNullOrEmpty(sce.Title)) { var time = DateTime.Parse(sce.Time.Trim()).ToString("yyyy-MM-dd"); bt.Draw(null, Color.White * alpha); CacheManager.DrawString(Session.Current.Font, sce.Title + " " + time, bt.Position + new Vector2(45, 2), Color.Black * alpha); } } }); btScenarioPlayersListPaged.ForEach(bt => { int index = btScenarioPlayersList.IndexOf(bt); if (index >= 0) { var play = CurrentScenario.Names.Split(',').NullToEmptyArray()[index]; bt.Draw(null, Color.White * alpha); CacheManager.DrawString(Session.Current.Font, play, bt.Position + new Vector2(45, 2), Color.Black * alpha); } }); if (CurrentScenario != null) { int resultRow = 0; int resultWidth = 0; CacheManager.DrawString(Session.Current.Font, CurrentScenario.Desc.SplitLineString(23, 7, ref resultRow, ref resultWidth), new Vector2(40, 460), Color.Black * alpha); } if (!String.IsNullOrEmpty(message)) { CacheManager.DrawString(Session.Current.Font, message, btNext.Position + new Vector2(70, 6), Color.Red * alpha); } } else if (MenuType == MenuType.Save) { CacheManager.DrawAvatar(@"Content\Textures\Resources\Start\Common.jpg", Vector2.Zero, Color.White * alpha, 1f); btSaveList.ForEach(bt => bt.Draw(null, Color.White * alpha)); btScenarioSelectListPaged.ForEach(bt => { int index = btScenarioSelectList.IndexOf(bt); if (index >= 0) { CacheManager.DrawString(Session.Current.Font, index.ToString(), bt.Position + new Vector2(45, 2), Color.Black * alpha); var sce = ScenarioList[index]; if (sce == null || String.IsNullOrEmpty(sce.Title)) { bt.Enable = false; CacheManager.DrawString(Session.Current.Font, "暂无进度", bt.Position + new Vector2(45 + 100, 2), Color.Black * alpha); } else { bt.Enable = true; CacheManager.DrawString(Session.Current.Font, sce.Title.WordsSubString(25), bt.Position + new Vector2(45 + 100, 2), Color.Blue * alpha); CacheManager.DrawString(Session.Current.Font, sce.Time.ToSeasonDate(), bt.Position + new Vector2(45 + 600, 2), Color.Blue * alpha); CacheManager.DrawString(Session.Current.Font, sce.Info, bt.Position + new Vector2(45 + 800, 2), Color.Blue * alpha); int playTime; if (int.TryParse(sce.PlayTime, out playTime)) { string viewTime = "(" + (playTime / 60 / 60) + ":" + (playTime / 60 % 60) + ")"; CacheManager.DrawString(Session.Current.Font, viewTime, bt.Position + new Vector2(45 + 900, 2), Color.Blue * alpha); } } if (index == 0) { CacheManager.DrawString(Session.Current.Font, "自动", bt.Position + new Vector2(45 + 35, 2), PlatformColor.DarkRed * alpha); } bt.Draw(null, Color.White * alpha); } }); if (!String.IsNullOrEmpty(message)) { CacheManager.DrawString(Session.Current.Font, message, new Vector2(40, 560), Color.Red * alpha); } } else if (MenuType == MenuType.Setting) { CacheManager.DrawAvatar(@"Content\Textures\Resources\Start\Common.jpg", Vector2.Zero, Color.White * alpha, 1f); btSettingList.ForEach(bt => bt.Draw(null, Color.White * alpha)); lbSettingList.ForEach(lb => lb.Draw(alpha)); if (CurrentSetting == "基本") { CacheManager.DrawString(Session.Current.Font, "语言", new Vector2(50, 120), Color.Black * alpha); CacheManager.DrawString(Session.Current.Font, "简体中文", new Vector2(50 + 100 + 50 - 12, 120), Color.Black * alpha); CacheManager.DrawString(Session.Current.Font, "传统中文", new Vector2(50 + 100 + 200 + 50 - 12, 120), Color.Black * alpha); //CacheManager.DrawString(Session.Current.Font, "难度", new Vector2(50, 120 + 60), Color.Black * alpha); //CacheManager.DrawString(Session.Current.Font, "战斗", new Vector2(50, 120 + 60 * 2), Color.Black * alpha); //CacheManager.DrawString(Session.Current.Font, "快速战斗的速度", new Vector2(50 + 300, 120 + 60 * 2), Color.Black * alpha); CacheManager.DrawString(Session.Current.Font, "玩家", new Vector2(50, 120 + 60 * 3), Color.Black * alpha); //int inHard = 0; //cbAIHardList.ForEach(cb => //{ // cb.Draw(null, Color.White * alpha); // CacheManager.DrawString(Session.Current.Font, hards2[inHard], new Vector2(cb.Position.X + 40 - 2, 120 + 60), Color.Black * alpha); // inHard++; //}); //tbBattleSpeed.tranAlpha = alpha; //tbBattleSpeed.Draw(); tbGamerName.tranAlpha = alpha; tbGamerName.Draw(); } else if (CurrentSetting == "环境") { CacheManager.DrawString(Session.Current.Font, "界面", new Vector2(50, 120), Color.Black * alpha); CacheManager.DrawString(Session.Current.Font, "窗口模式", new Vector2(50 + 100 + 50, 120), Color.Black * alpha); CacheManager.DrawString(Session.Current.Font, "全屏模式", new Vector2(50 + 100 + 200 + 50, 120), Color.Black * alpha); //CacheManager.DrawString(Session.Current.Font, "925*520", new Vector2(50 + 100 + 50, 120 + 60), Color.Black * alpha); //CacheManager.DrawString(Session.Current.Font, "1120*630", new Vector2(50 + 100 + 200 + 50, 120 + 60), Color.Black * alpha); //CacheManager.DrawString(Session.Current.Font, "1024*768", new Vector2(50 + 100 + 400 + 50, 120 + 60), Color.Black * alpha); //CacheManager.DrawString(Session.Current.Font, "分辨", new Vector2(50, 120 + 60), Color.Black * alpha); CacheManager.DrawString(Session.Current.Font, "音乐", new Vector2(50, 120 + 60 * 2), Color.Black * alpha); CacheManager.DrawString(Session.Current.Font, "声音", new Vector2(50, 120 + 60 * 3), Color.Black * alpha); nstMusic.Draw(alpha); nstSound.Draw(alpha); } else if (CurrentSetting == "人物") { } else if (CurrentSetting == "参数") { } else if (CurrentSetting == "电脑") { } } else if (MenuType == MenuType.About) { CacheManager.DrawAvatar(@"Content\Textures\Resources\Start\Common.jpg", Vector2.Zero, Color.White * alpha, 1f); CacheManager.DrawString(Session.Current.Font, String.Join(System.Environment.NewLine, aboutLines), new Vector2(40, 40), Color.Black * alpha, 0f, Vector2.Zero, 0.8f, SpriteEffects.None, 0f); btAboutList.ForEach(bt => bt.Draw(null, Color.White * alpha)); } btPre.Draw(null, Color.White * alpha); btNext.Draw(null, Color.White * alpha); btPre1.Draw(null, Color.White * alpha); btNext1.Draw(null, Color.White * alpha); if (Platform.PlatFormType == PlatFormType.Win || Platform.PlatFormType == PlatFormType.Desktop || Platform.PlatFormType == PlatFormType.UWP && !Platform.IsMobile) { CacheManager.DrawAvatar(@"Content\Textures\Resources\MouseArrow\Normal.png", InputManager.Position, Color.White * alpha, 1f); } //var str = @"Content/Textures/GameComponents/tupianwenzi/Data/tupian/TruceDiplomaticRelation.jpg"; //CacheManager.DrawAvatar(str, Vector2.Zero, Color.White, 1f); //str = @"Content/Textures/GameComponents/tupianwenzi/Data/tupian/beiyue.jpg"; //CacheManager.DrawAvatar(str, new Vector2(0, 300), Color.White, 1f); //str = @"Content/Textures/GameComponents/PersonPortrait/Images/Default/19207.jpg"; //CacheManager.DrawAvatar(str, new Vector2(500, 200), Color.White, 1f); }
//DRAW public void Draw(GameTime gameTime, SpriteBatch spriteBatch) { //Cloud animation m_elapsed = (float)gameTime.ElapsedGameTime.TotalMilliseconds; //Timer m_timer -= (int)m_elapsed; if (m_cloud2Pos.X < -464) { m_cloud1Pos.X = 768; m_cloud2Pos.X = 768 + 774; } if (m_timer <= -30) //Duration { if (m_cloud1Pos.X > -464) { m_cloud1Pos.X -= 1; } m_cloud2Pos.X -= 1; m_timer = 0; //Reset Timer } //Scraffy animation m_scraffyElapsed = (float)gameTime.ElapsedGameTime.TotalMilliseconds; //Timer m_scraffyTimer -= (int)m_scraffyElapsed; if (m_scraffyTimer <= -370) //Duration { if (m_scraffyAnim == ScraffyAnim.Frame1) { m_scraffyAnim = ScraffyAnim.Frame2; //Frame 2 } else if (m_scraffyAnim == ScraffyAnim.Frame2) { m_scraffyAnim = ScraffyAnim.Frame3; //Frame 3 } else if (m_scraffyAnim == ScraffyAnim.Frame3) { m_scraffyAnim = ScraffyAnim.Frame4; //Frame 2 } else if (m_scraffyAnim == ScraffyAnim.Frame4) { m_scraffyAnim = ScraffyAnim.Frame1; //Frame 1 } m_scraffyTimer = 0; //Reset Timer } spriteBatch.Draw(m_background, new Vector2(0, 0), Color.White); spriteBatch.Draw(m_cloud1, m_cloud1Pos, Color.White); spriteBatch.Draw(m_cloud2, m_cloud2Pos, Color.White); //Scraffy if (m_scraffyAnim == ScraffyAnim.Frame1) { spriteBatch.Draw(m_scraffyFrame1, new Vector2(0, 584), Color.White); } else if (m_scraffyAnim == ScraffyAnim.Frame2 || m_scraffyAnim == ScraffyAnim.Frame4) { spriteBatch.Draw(m_scraffyFrame2, new Vector2(0, 584), Color.White); } else if (m_scraffyAnim == ScraffyAnim.Frame3) { spriteBatch.Draw(m_scraffyFrame3, new Vector2(0, 584), Color.White); } spriteBatch.Draw(m_foreground, new Vector2(0, 0), Color.White); spriteBatch.Draw(m_logo, new Vector2(16, 127), Color.White); //Button m_playButton.Draw(spriteBatch); m_scoresButton.Draw(spriteBatch); m_optionButton.Draw(spriteBatch); m_creditButton.Draw(spriteBatch); //Score spriteBatch.DrawString(Resource.ImpactBig, "Best Score: " + m_bestScore, new Vector2(50, 310), Color.DarkGreen); }