This is a transitioning Vector2. This is used like a tfloat.
Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InstructionsScreen"/> class.
 /// </summary>
 /// <param name="imageName">Name of the image containing the instructions.</param>
 public InstructionsScreen(string imageName)
     : base()
 {
     this.imageName = imageName;
     this.position = new tVector2(1920f / 2f - 2000f, 1080f / 2f);
     this.position.GoTo(1920f / 2f, 1080f / 2f, 0.3f);
     this.shouldDispose = false;
     this.FadingOut = true;
 }
        public SPRMainScreen(int scoreBoardIndex)
            : base()
        {
            this.menu = new MainMenu(
                new Vector2(0, -60),
                new MenuAction[]
                {
                    new MenuAction(ActionType.Select, new PlayGameDelegate(scoreBoardIndex))
                },
                50,
                scoreBoardIndex);

            this.textDrawPosition = new Vector2(265, -225);
            this.textDrawOrigin = FontStatic.Get("defaultFont").MeasureString("Super Power");
            this.position = new tVector2(1920f / 2f, 1080f / 2f);
            this.position.GoTo(1920f / 2f, 1080f / 2f, 0.3f, true);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PauseScreen"/> class.
        /// </summary>
        public TextScreen(string text)
            : base()
        {
            terminalText = text;
            textLocationHolder = text;
            this.textDrawPosition = new Vector2(0, -225);
            this.textDrawOrigin = FontStatic.Get("defaultFont").MeasureString(terminalText) / 2f;
            this.position = new tVector2(1920f / 2f - 2000f, 1080f / 2f);
            this.position.GoTo(1920f / 2f, 1080f / 2f, 0.3f, true);
            this.drawLagTime = DateTime.Now.Ticks + 1000000;
            //this.background = new HypercubeDisplay(
            //    new Rectangle((int)(this.position.Value.X - 584f / 2f) - 3, (int)(this.position.Value.Y - 700f / 2f) - 3, 584 + 6, 700 + 6),
            //    3,
            //    this.random,
            //    0.2f);
            if (terminalText.Length > 23)
            {
                string[] temp = terminalText.Split(' ');
                terminalText = "";
                int count = 1;
                foreach (string word in temp)
                {

                    if (terminalText.Length + word.Length < 28 * count)
                    {
                        terminalText = terminalText + word + " ";
                    }
                    else
                    {
                        count++;
                        terminalText = terminalText + "\n" + word + " ";
                    }
                }
                this.textDrawOrigin = FontStatic.Get("defaultFont").MeasureString(terminalText) / 2f;
                this.textDrawOrigin.Y -= count * 60;
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PauseScreen"/> class.
        /// </summary>
        public PauseScreen()
            : base()
        {
            this.menu = new PauseMenu(
                new Vector2(0, -60),
                new MenuAction[]
                {
                    new MenuAction(ActionType.GoBack, new QuitPauseScreenDelegate()),
                },
                75);

            this.textDrawPosition = new Vector2(0, -225);
            this.textDrawOrigin = FontStatic.Get("defaultFont").MeasureString("Paused") / 2f;
            this.position = new tVector2(1920f / 2f - 2000f, 1080f / 2f);
            this.position.GoTo(1920f / 2f, 1080f / 2f, 0.3f, true);
            this.drawLagTime = DateTime.Now.Ticks + 1000000;
            this.background = new HypercubeDisplay(
                new Rectangle((int)(this.position.Value.X - 584f / 2f) - 3, (int)(this.position.Value.Y - 700f / 2f) - 3, 584 + 6, 700 + 6),
                3,
                this.random,
                0.2f);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Updates this instance. This makes sure that GameClock is paused,
        /// and it also updates the menu.
        /// </summary>
        public override void Update()
        {
            base.Update();

            // Only pause the gameclock if the screen is not fading out.
            if (!this.FadingOut)
            {
                GameClock.Pause();
            }
            else
            {
                GameClock.Unpause();
            }

            this.position.Update();

            // If it is fading out and the pause menu is done moving, then dispose.
            if (this.FadingOut && !this.position.IsTransitioning)
            {
                GameClock.Unpause();
                this.Disposed = true;
            }

            this.menu.position = this.position.Value;
            this.menu.Update();
            this.background.Set(this.position.X.Value, this.position.Y.Value);
            this.background.Update();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="GameOverScreen"/> class.
        /// </summary>
        public GameOverScreen(uint score)
            : base()
        {
            this.score = score;
            this.actionAvailableTime = DateTime.Now.Ticks + 30000000;
            GameClock.Pause();

            this.textDrawPosition = new Vector2(0, -125);
            this.textDrawOrigin = FontStatic.Get("defaultFont").MeasureString("Game Over") / 2f;
            this.scoreLogoPosition = new Vector2(0, -20f);
            this.scoreLogoOrigin = FontStatic.Get("defaultFont").MeasureString("Score") / 2f;
            this.scorePosition = new Vector2(0, 50f);
            this.scoreOrigin = FontStatic.Get("defaultFont").MeasureString(Drawer.FormatNumber(this.score)) / 2f;
            this.aButtonPosition = new Vector2(-240f, 150f);
            this.bButtonPosition = new Vector2(100f, 150f);
            this.actionXOffset = new Vector2(50f, 0);
            this.buttonOrigin = FontStatic.Get("ControllerFont").MeasureString(")") / 2f;
            this.aActionOrigin = new Vector2(0, FontStatic.Get("defaultFont").MeasureString("Replay").Y / 2);
            this.bActionOrigin = new Vector2(0, FontStatic.Get("defaultFont").MeasureString("Quit").Y / 2);
            this.buttonColor = Color.Transparent;

            this.position = new tVector2(1920f / 2f - 2000f, 1080f / 2f);
            this.position.GoTo(1920f / 2f, 1080f / 2f, 0.3f, true);
            this.background = new HypercubeDisplay(
                new Rectangle((int)(this.position.Value.X - 685f / 2f) - 3, (int)(this.position.Value.Y - 370f / 2f) - 3, 685 + 6, 370 + 6),
                3,
                this.random,
                0.2f);
        }
        public override void Update()
        {
            base.Update();

            this.menu.position = this.position.Value;

            this.menu.Update();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CreditsScreen"/> class.
        /// </summary>
        public CreditsScreen()
            : base()
        {
            this.shouldDispose = false;
            this.FadingOut = true;
            this.position = new tVector2(1920f / 2f - 2000f, 1080f / 2f);
            this.position.GoTo(1920f / 2f, 1080f / 2f, 0.3f, true);
            this.background = new HypercubeDisplay(
                new Rectangle((int)(this.position.Value.X - 1450f / 2f) - 3, (int)(this.position.Value.Y - 800f / 2f) - 3, 1450 + 6, 800 + 6),
                3,
                this.random,
                0.2f);
            this.scrollPosition = new tVector2(0, 1000);
            this.scrollPosition.GoTo(0, -21000, 82f, true);
            this.titleOrigin = FontStatic.Get("defaultFont").MeasureString("Credits") / 2f;
            this.viewport = new Viewport(
                (int)((this.position.Value.X - 1450f / 2f) * Drawer.GetRatio()),
                (int)((this.position.Value.Y - 800f / 2f) * Drawer.GetRatio()),
                (int)(1450 * Drawer.GetRatio()),
                (int)(800 * Drawer.GetRatio()));
            this.previousPositionX = 0;
            string fullText =
            @"Ty Taylor
            Supreme Overlord of the Universe
            Framework and Game Engine

            Marc Buchner
            Assistant to Mr. Taylor

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Copyright 2011
            Case Western Reserve University
            http://eecs.case.edu";

            this.display = fullText.Split('\n').ToList<string>();
            float unitSpacing = FontStatic.Get("defaultFont").MeasureString(" ").Y;
            this.verticleSpacing = new List<Vector2>(this.display.Count);
            for (int i = 0; i < this.display.Count; i++)
            {
                this.verticleSpacing.Add(new Vector2(-800, 300 + i * unitSpacing));
            }
        }