コード例 #1
0
        public TitleScreenClass(ContentManager content, GraphicsDevice device, Vector2 Screen)
        {
            Title = content.Load<Texture2D>("Images/blackSmaller");
            logo = content.Load<Texture2D>("Images/Logo");

            ResOffset = new Vector2(Screen.X / 1920, Screen.Y / 1080);

            endLogoPositionSize = new Vector4(new Vector2(Screen.X / 2, 200 * ResOffset.Y), ((ResOffset.X + ResOffset.Y) / 2) * 0.5f, ((ResOffset.X + ResOffset.Y) / 2) * 0.5f);

            logoAnim = new DynamicAnimation(new Vector2[] { Screen / 2, ResOffset }, new Vector2[] { new Vector2(endLogoPositionSize.X, endLogoPositionSize.Y), new Vector2(endLogoPositionSize.Z, endLogoPositionSize.W) }, TimeSpan.FromMilliseconds(logoMoveTime), false);

            loading = new LoadingScreenClass(content, LoadingTime, true);
            blackTex = new Texture2D(device, 1, 1);
        }
コード例 #2
0
        public TitleScreenClass(ContentManager content, GraphicsDevice device, Vector2 Screen)
        {
            Title = content.Load <Texture2D>("Images/blackSmaller");
            logo  = content.Load <Texture2D>("Images/Logo");

            ResOffset = new Vector2(Screen.X / 1920, Screen.Y / 1080);

            endLogoPositionSize = new Vector4(new Vector2(Screen.X / 2, 200 * ResOffset.Y), ((ResOffset.X + ResOffset.Y) / 2) * 0.5f, ((ResOffset.X + ResOffset.Y) / 2) * 0.5f);

            logoAnim = new DynamicAnimation(new Vector2[] { Screen / 2, ResOffset }, new Vector2[] { new Vector2(endLogoPositionSize.X, endLogoPositionSize.Y), new Vector2(endLogoPositionSize.Z, endLogoPositionSize.W) }, TimeSpan.FromMilliseconds(logoMoveTime), false);

            loading  = new LoadingScreenClass(content, LoadingTime, true);
            blackTex = new Texture2D(device, 1, 1);
        }
コード例 #3
0
ファイル: Game1.cs プロジェクト: noamg97/ProjectPenguin
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            fontLoader  = new FontLoader(Content);
            playing     = new PlayingStateClass(graphics, GraphicsDevice, Content);
            titleScreen = new TitleScreenClass(Content, GraphicsDevice, new Vector2(graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight));
            loading     = new LoadingScreenClass(Content, null, false);

            Mouse.SetPosition(graphics.GraphicsDevice.Viewport.Width / 2, graphics.GraphicsDevice.Viewport.Height / 2);

            menu = new MainMenuStateClass(Content, new Vector2(graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight), true);

            ChangeGameState(CurrentGameState);

            buttonSound      = Content.Load <SoundEffect>("Sounds/button");
            buttonClickSound = Content.Load <SoundEffect>("Sounds/buttonClick");
            backSound        = Content.Load <SoundEffect>("Sounds/back");
        }
コード例 #4
0
ファイル: Game1.cs プロジェクト: noamg97/ProjectPenguin
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            fontLoader = new FontLoader(Content);
            playing = new PlayingStateClass(graphics, GraphicsDevice, Content);
            titleScreen = new TitleScreenClass(Content, GraphicsDevice, new Vector2(graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight));
            loading = new LoadingScreenClass(Content, null, false);

            Mouse.SetPosition(graphics.GraphicsDevice.Viewport.Width / 2, graphics.GraphicsDevice.Viewport.Height / 2);

            menu = new MainMenuStateClass(Content, new Vector2(graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight), true);

            ChangeGameState(CurrentGameState);

            buttonSound = Content.Load<SoundEffect>("Sounds/button");
            buttonClickSound = Content.Load<SoundEffect>("Sounds/buttonClick");
            backSound = Content.Load<SoundEffect>("Sounds/back");
        }