/// <summary> /// Constructor. /// </summary> public LoadingScreen() { TransitionOnTime = TimeSpan.FromSeconds(0.5f); TransitionOffTime = TimeSpan.FromSeconds(0.5f); this.spriteBG = new GameSprite2D(); this.spriteLoadingText = new GameSprite2D(); }
/// <summary> /// Constructor. /// </summary> public MainMenuScreen() { TransitionOnTime = TimeSpan.FromSeconds(0.5f); TransitionOffTime = TimeSpan.FromSeconds(1.0f); this.spriteMain = new GameSprite2D(); this.spriteButton = new GameSprite2D(); }
/// <summary> /// Constructor. /// </summary> public VersusReadyScreen() { TransitionOnTime = TimeSpan.FromSeconds(0.5f); TransitionOffTime = TimeSpan.FromSeconds(1.0f); this.spriteBG = new GameSprite2D(); this.spriteSelect = new GameSprite2D(); this.spriteTextImage = new GameSprite2D(); spriteObjSelectCursor = new Sprite2DObject[2]; }
public override void UnloadContent() { this.refScene2DTopRoot.RemoveChild(this.spriteBox, false); if (FrameworkCore.TextManager != null) { FrameworkCore.TextManager.RemoveText(this.textControlsItem); FrameworkCore.TextManager.RemoveText(this.textMessageItem); } this.spriteBox = null; this.textMessageItem = null; this.textControlsItem = null; }
/// <summary> /// creates Hud images for versus game. /// </summary> public override void CreateHud() { ViewCamera viewCamera = FrameworkCore.CurrentCamera; int viewCount = viewCamera.Count; this.textKillScore = new GameText[viewCount]; this.textKillConditionScore = new GameText[viewCount]; Color scoreColor = new Color(136, 217, 224); // kill score and condition score for (int i = 0; i < viewCount; i++) { this.textKillScore[i] = new GameText( this.fontHud, "0", 0, 0, scoreColor); this.refSceneHudRoot.AddChild(this.textKillScore[i]); this.textKillConditionScore[i] = new GameText( this.fontHud, string.Format("/ {0}", RobotGameGame.VersusGameInfo.killPoint), 0, 0, scoreColor); this.refSceneHudRoot.AddChild(this.textKillConditionScore[i]); } this.spriteHudVersus = new GameSprite2D(); this.spriteHudVersus.Create(4, "Textures/VS_Text"); this.refSceneHudRoot.AddChild(this.spriteHudVersus); // 1P image this.spriteObjHudVersus1P = this.spriteHudVersus.AddSprite(0, "Versus 1P"); // 2P image this.spriteObjHudVersus2P = this.spriteHudVersus.AddSprite(1, "Versus 2P"); // You win this.spriteObjHudVersusWin = this.spriteHudVersus.AddSprite(2, "Versus Win"); this.spriteObjHudVersusWin.Visible = false; // You lose this.spriteObjHudVersusLose = this.spriteHudVersus.AddSprite(3, "Versus Lose"); this.spriteObjHudVersusLose.Visible = false; base.CreateHud(); }
/// <summary> /// Constructs a new screen manager component. /// </summary> public GameScreenManager(Game game) : base(game) { scene2DFadeRoot = FrameworkCore.Scene2DFadeLayer; fadeSprite = new GameSprite2D(); scene2DFadeRoot.AddChild(fadeSprite); // Controller screenInput[0] = new GameScreenInput(PlayerIndex.One); screenInput[1] = new GameScreenInput(PlayerIndex.Two); screenInput[2] = new GameScreenInput(PlayerIndex.Three); screenInput[3] = new GameScreenInput(PlayerIndex.Four); }
/// <summary> /// loads graphics contents. This uses the shared ContentManager /// provided by the ScreenManager, so the content will remain loaded forever. /// Whenever a subsequent MessageBoxScreen tries to load this same content, /// it will just get back another reference to the already loaded instance. /// </summary> public override void LoadContent() { spriteBox = new GameSprite2D(); spriteBox.Create(1, "Textures/Text_Window"); refScene2DTopRoot.AddChild(spriteBox); spriteObjBox = spriteBox.AddSprite(0, "MessageBox frame"); textMessageItem = new TextItem(messageFont, message, 0, 0, new Color(136, 217, 224)); FrameworkCore.TextManager.AddText(textMessageItem); textControlsItem = new TextItem(messageFont, controls, 0, 0, Color.White); FrameworkCore.TextManager.AddText(textControlsItem); // Resizing all images OnSize(); }