public CreditsLine() { // Set up the sprites Sprite = new TextDrawableSprite(Game.GetFont(FontSize)); Sprite.Tint = Color.White; Sprite.Alignment = ContentAlignment.TopLeft; }
public CreditsLine() { // Set up the sprites Sprite = new TextDrawableSprite(Game.GetFont(FontSize)); Sprite.Tint = Color.White; Sprite.Alignment = ContentAlignment.TopLeft; }
/// <summary> /// Constructs the minor mode and sets up the internal /// sprites. /// </summary> public EndOfGameMinorMode() { // Create the game over text text = new TextDrawableSprite(Game.GetFont(FontSize), "Game\nOver"); text.Tint = Color.White; text.Alignment = ContentAlignment.MiddleCenter; sprites.Add(text); }
/// <summary> /// Constructs the minor mode and sets up the internal /// sprites. /// </summary> public EndOfGameMinorMode() { // Create the game over text text = new TextDrawableSprite(Game.GetFont(FontSize), "Game\nOver"); text.Tint = Color.White; text.Alignment = ContentAlignment.MiddleCenter; sprites.Add(text); }
/// <summary> /// Constructs the minor mode and sets up the internal /// sprites. /// </summary> public CreditsMode() { // Create the titles text = new TextDrawableSprite(Game.GetFont(TitleFontSize), "Credits"); text.Tint = Color.White; text.Alignment = ContentAlignment.TopLeft; sprites.Add(text); category = new TextDrawableSprite(Game.GetFont(FontSize)); category.Tint = Color.White; category.Alignment = ContentAlignment.TopRight; sprites.Add(category); }
/// <summary> /// Constructs the minor mode and sets up the internal /// sprites. /// </summary> public CreditsMode() { // Create the titles text = new TextDrawableSprite(Game.GetFont(TitleFontSize), "Credits"); text.Tint = Color.White; text.Alignment = ContentAlignment.TopLeft; sprites.Add(text); category = new TextDrawableSprite(Game.GetFont(FontSize)); category.Tint = Color.White; category.Alignment = ContentAlignment.TopRight; sprites.Add(category); }
/// <summary> /// Constructs the minor mode and sets up the internal /// sprites. /// </summary> public AssetLoadingMode() { // Create the game over text text = new TextDrawableSprite(Game.GetFont(FontSize), "Loading"); text.Tint = Color.White; text.Alignment = ContentAlignment.MiddleCenter; sprites.Add(text); text2 = new TextDrawableSprite(Game.GetFont(SmallFontSize), "100%"); text2.Tint = Color.White; text2.Alignment = ContentAlignment.BottomLeft; sprites.Add(text2); }
/// <summary> /// Constructs the minor mode and sets up the internal /// sprites. /// </summary> public AssetLoadingMode() { // Create the game over text text = new TextDrawableSprite(Game.GetFont(FontSize), "Loading"); text.Tint = Color.White; text.Alignment = ContentAlignment.MiddleCenter; sprites.Add(text); text2 = new TextDrawableSprite(Game.GetFont(SmallFontSize), "100%"); text2.Tint = Color.White; text2.Alignment = ContentAlignment.BottomLeft; sprites.Add(text2); }
protected DisplayStatusMinorMode() { // Create a sprite viewport to handle everything sprites = new SpriteViewport(); // Create the heart and star icons heartSprite = AssetLoader.Instance.CreateSprite("Heart"); sprites.Add(heartSprite); heartText = new TextDrawableSprite(Game.GetFont(FullTextSize)); heartText.Tint = Constants.HeartColor; heartText.Text = Game.State.Hearts.ToString(); heartText.Alignment = ContentAlignment.MiddleLeft; sprites.Add(heartText); starSprite = AssetLoader.Instance.CreateSprite("Star"); sprites.Add(starSprite); starText = new TextDrawableSprite(Game.GetFont(FullTextSize)); starText.Tint = Constants.StarColor; starText.Text = Game.State.Stars.ToString(); starText.Alignment = ContentAlignment.MiddleLeft; sprites.Add(starText); chestSprite = AssetLoader.Instance.CreateSprite(ChestDrawableName); sprites.Add(chestSprite); chestText = new TextDrawableSprite(Game.GetFont(FullTextSize)); chestText.Tint = Constants.ChestColor; chestText.Text = "0"; chestText.Alignment = ContentAlignment.MiddleLeft; sprites.Add(chestText); // Create the viewport viewport = new SpriteViewport(); viewport.ClipContents = true; sprites.Add(viewport); // Add the text elements subtitle = new TextDrawableSprite( Game.GetFont(NewFontSize), ""); subtitle.Tint = Color.FromArgb(128, Color.White); subtitle.Alignment = ContentAlignment.TopCenter; subtitle.Visible = false; viewport.Add(subtitle); // Create the title text title = new TextDrawableSprite( Game.GetFont(TitleFontSize), ""); title.Tint = Color.White; title.Alignment = ContentAlignment.TopCenter; title.Visible = false; viewport.Add(title); // Create the title text text = new TextLayoutDrawableSprite( Game.GetFont(DescriptionFontSize), ""); text.Tint = Color.White; text.Alignment = ContentAlignment.TopCenter; viewport.Add(text); }
protected DisplayStatusMinorMode() { // Create a sprite viewport to handle everything sprites = new SpriteViewport(); // Create the heart and star icons heartSprite = AssetLoader.Instance.CreateSprite("Heart"); sprites.Add(heartSprite); heartText = new TextDrawableSprite(Game.GetFont(FullTextSize)); heartText.Tint = Constants.HeartColor; heartText.Text = Game.State.Hearts.ToString(); heartText.Alignment = ContentAlignment.MiddleLeft; sprites.Add(heartText); starSprite = AssetLoader.Instance.CreateSprite("Star"); sprites.Add(starSprite); starText = new TextDrawableSprite(Game.GetFont(FullTextSize)); starText.Tint = Constants.StarColor; starText.Text = Game.State.Stars.ToString(); starText.Alignment = ContentAlignment.MiddleLeft; sprites.Add(starText); chestSprite = AssetLoader.Instance.CreateSprite(ChestDrawableName); sprites.Add(chestSprite); chestText = new TextDrawableSprite(Game.GetFont(FullTextSize)); chestText.Tint = Constants.ChestColor; chestText.Text = "0"; chestText.Alignment = ContentAlignment.MiddleLeft; sprites.Add(chestText); // Create the viewport viewport = new SpriteViewport(); viewport.ClipContents = true; sprites.Add(viewport); // Add the text elements subtitle = new TextDrawableSprite( Game.GetFont(NewFontSize), ""); subtitle.Tint = Color.FromArgb(128, Color.White); subtitle.Alignment = ContentAlignment.TopCenter; subtitle.Visible = false; viewport.Add(subtitle); // Create the title text title = new TextDrawableSprite( Game.GetFont(TitleFontSize), ""); title.Tint = Color.White; title.Alignment = ContentAlignment.TopCenter; title.Visible = false; viewport.Add(title); // Create the title text text = new TextLayoutDrawableSprite( Game.GetFont(DescriptionFontSize), ""); text.Tint = Color.White; text.Alignment = ContentAlignment.TopCenter; viewport.Add(text); }
/// <summary> /// Constructs the viewport and arranges all the needed /// elements. /// </summary> public IndicatorsViewport() { // Set the default values BackgroundColor = Color.FromArgb(128, Color.Black); Z = 100; // Create the status viewport statusViewport = new SpriteViewport(); statusViewport.ClipContents = true; statusViewport.Z = 200; Add(statusViewport); // Load the mini icons heart = AssetLoader.Instance.CreateSprite(Constants.MiniHeartName); heart.Z = 300; heart.Point = new PointF(5, 0); statusViewport.Add(heart); star = AssetLoader.Instance.CreateSprite(Constants.MiniStarName); star.Point = new PointF(5, FontSize + 2); star.Z = 300; statusViewport.Add(star); clock = AssetLoader.Instance.CreateSprite(Constants.MiniClockName); clock.Z = 300; clock.Point = new PointF(155, 0); statusViewport.Add(clock); bug = AssetLoader.Instance.CreateSprite(Constants.MiniBugName); bug.Point = new PointF(155, FontSize + 2); bug.Z = 300; statusViewport.Add(bug); // Create the heart scores heartScore = new TextDrawableSprite(Game.GetFont(FontSize), Game.State.Hearts.ToString()); heartScore.Z = 300; heartScore.Point = new PointF(35, 15); heartScore.Tint = Constants.HeartColor; heartScore.Alignment = ContentAlignment.MiddleLeft; statusViewport.Add(heartScore); // Create the star scores starScore = new TextDrawableSprite(Game.GetFont(FontSize), Game.State.Stars.ToString()); starScore.Z = 300; starScore.Point = new PointF(35, FontSize + 15 + 4); starScore.Tint = Constants.StarColor; starScore.Alignment = ContentAlignment.MiddleLeft; statusViewport.Add(starScore); // Create the clock scores clockScore = new TextDrawableSprite(Game.GetFont(FontSize), Game.State.SecondsRemaining.ToString()); clockScore.Z = 300; clockScore.Point = new PointF(185, heartScore.Point.Y); clockScore.Tint = Constants.ClockColor; clockScore.Alignment = ContentAlignment.MiddleLeft; statusViewport.Add(clockScore); // Create the star scores bugScore = new TextDrawableSprite(Game.GetFont(FontSize), Game.State.Stars.ToString()); bugScore.Z = 300; bugScore.Point = new PointF(clockScore.Point.X, starScore.Point.Y); bugScore.Tint = Constants.BugColor; bugScore.Alignment = ContentAlignment.MiddleLeft; statusViewport.Add(bugScore); // Create the prayer viewport prayerViewport = new SpriteViewport(); prayerViewport.ClipContents = true; Add(prayerViewport); }
/// <summary> /// Indicates to the game mode that it is activated. /// </summary> public void Activate() { // Set up the sprites sprites.IsMouseSensitive = true; Game.SpriteManager.Add(sprites); // Create the big text title = new TextDrawableSprite(Game.GetFont(FontSize), "Cute God"); title.Alignment = ContentAlignment.TopCenter; title.Tint = Color.White; sprites.Add(title); System.Version v = GetType().Assembly.GetName().Version; version = new TextDrawableSprite(Game.GetFont(SmallFontSize), String.Format("{0}.{1}.{2}", v.Major, v.Minor, v.Build)); version.Alignment = ContentAlignment.BottomRight; version.Tint = Color.FromArgb(64, Color.White); sprites.Add(version); // Create the buttons newGame = new MainMenuButton(AssetLoader.Instance .CreateDrawable("new-game")); newGame.Clicked += NewGameClicked; sprites.Add(newGame); settings = new MainMenuButton(AssetLoader.Instance .CreateDrawable("settings")); sprites.Add(settings); resume = new MainMenuButton(AssetLoader.Instance .CreateDrawable("resume-game")); if (Game.PlayMode != null) resume.Clicked += ResumeClicked; sprites.Add(resume); help = new MainMenuButton(AssetLoader.Instance .CreateDrawable("help")); sprites.Add(help); scores = new MainMenuButton(AssetLoader.Instance .CreateDrawable("high-scores")); sprites.Add(scores); credits = new MainMenuButton(AssetLoader.Instance .CreateDrawable("credits")); credits.Clicked += CreditsClicked; sprites.Add(credits); quit = new MainMenuButton(AssetLoader.Instance .CreateDrawable("quit")); quit.Clicked += QuitClicked; sprites.Add(quit); // Create the block viewport board = new BlockBoard(BoardRows, BoardColumns); board.BlockMovingChanged += OnBlockMovingChanged; viewport = new BlockViewport(board, AssetLoader.Instance); viewport.FocusPosition = Constants.FocusPosition; PopulateBoard(); // We don't add to the sprites since we are manually // drawing it to add a black screen in front of it. }
/// <summary> /// Indicates to the game mode that it is activated. /// </summary> public void Activate() { // Set up the sprites sprites.IsMouseSensitive = true; Game.SpriteManager.Add(sprites); // Create the big text title = new TextDrawableSprite(Game.GetFont(FontSize), "Cute God"); title.Alignment = ContentAlignment.TopCenter; title.Tint = Color.White; sprites.Add(title); System.Version v = GetType().Assembly.GetName().Version; version = new TextDrawableSprite(Game.GetFont(SmallFontSize), String.Format("{0}.{1}.{2}", v.Major, v.Minor, v.Build)); version.Alignment = ContentAlignment.BottomRight; version.Tint = Color.FromArgb(64, Color.White); sprites.Add(version); // Create the buttons newGame = new MainMenuButton(AssetLoader.Instance .CreateDrawable("new-game")); newGame.Clicked += NewGameClicked; sprites.Add(newGame); settings = new MainMenuButton(AssetLoader.Instance .CreateDrawable("settings")); sprites.Add(settings); resume = new MainMenuButton(AssetLoader.Instance .CreateDrawable("resume-game")); if (Game.PlayMode != null) { resume.Clicked += ResumeClicked; } sprites.Add(resume); help = new MainMenuButton(AssetLoader.Instance .CreateDrawable("help")); sprites.Add(help); scores = new MainMenuButton(AssetLoader.Instance .CreateDrawable("high-scores")); sprites.Add(scores); credits = new MainMenuButton(AssetLoader.Instance .CreateDrawable("credits")); credits.Clicked += CreditsClicked; sprites.Add(credits); quit = new MainMenuButton(AssetLoader.Instance .CreateDrawable("quit")); quit.Clicked += QuitClicked; sprites.Add(quit); // Create the block viewport board = new BlockBoard(BoardRows, BoardColumns); board.BlockMovingChanged += OnBlockMovingChanged; viewport = new BlockViewport(board, AssetLoader.Instance); viewport.FocusPosition = Constants.FocusPosition; PopulateBoard(); // We don't add to the sprites since we are manually // drawing it to add a black screen in front of it. }
/// <summary> /// Constructs the viewport and arranges all the needed /// elements. /// </summary> public IndicatorsViewport() { // Set the default values BackgroundColor = Color.FromArgb(128, Color.Black); Z = 100; // Create the status viewport statusViewport = new SpriteViewport(); statusViewport.ClipContents = true; statusViewport.Z = 200; Add(statusViewport); // Load the mini icons heart = AssetLoader.Instance.CreateSprite(Constants.MiniHeartName); heart.Z = 300; heart.Point = new PointF(5, 0); statusViewport.Add(heart); star = AssetLoader.Instance.CreateSprite(Constants.MiniStarName); star.Point = new PointF(5, FontSize + 2); star.Z = 300; statusViewport.Add(star); clock = AssetLoader.Instance.CreateSprite(Constants.MiniClockName); clock.Z = 300; clock.Point = new PointF(155, 0); statusViewport.Add(clock); bug = AssetLoader.Instance.CreateSprite(Constants.MiniBugName); bug.Point = new PointF(155, FontSize + 2); bug.Z = 300; statusViewport.Add(bug); // Create the heart scores heartScore = new TextDrawableSprite(Game.GetFont(FontSize), Game.State.Hearts.ToString()); heartScore.Z = 300; heartScore.Point = new PointF(35, 15); heartScore.Tint = Constants.HeartColor; heartScore.Alignment = ContentAlignment.MiddleLeft; statusViewport.Add(heartScore); // Create the star scores starScore = new TextDrawableSprite(Game.GetFont(FontSize), Game.State.Stars.ToString()); starScore.Z = 300; starScore.Point = new PointF(35, FontSize + 15 + 4); starScore.Tint = Constants.StarColor; starScore.Alignment = ContentAlignment.MiddleLeft; statusViewport.Add(starScore); // Create the clock scores clockScore = new TextDrawableSprite(Game.GetFont(FontSize), Game.State.SecondsRemaining.ToString()); clockScore.Z = 300; clockScore.Point = new PointF(185, heartScore.Point.Y); clockScore.Tint = Constants.ClockColor; clockScore.Alignment = ContentAlignment.MiddleLeft; statusViewport.Add(clockScore); // Create the star scores bugScore = new TextDrawableSprite(Game.GetFont(FontSize), Game.State.Stars.ToString()); bugScore.Z = 300; bugScore.Point = new PointF(clockScore.Point.X, starScore.Point.Y); bugScore.Tint = Constants.BugColor; bugScore.Alignment = ContentAlignment.MiddleLeft; statusViewport.Add(bugScore); // Create the prayer viewport prayerViewport = new SpriteViewport(); prayerViewport.ClipContents = true; Add(prayerViewport); }