示例#1
0
        public MenuScreen(ref SpriteBatch sb, List<Button> b)
        {
            int height = Constants.graphics.PreferredBackBufferHeight;
            int width = Constants.graphics.PreferredBackBufferWidth;

            SB = sb;
            Backgrounds = new List<TextureMap>();
            fish = new List<TextureMap>();
            fishPos = new List<Vector2>();
            fishPos.Add(new Vector2((width / 2), height / 2));
            fishPos.Add(new Vector2((width / 2) + 122, (height / 2) + 122));
            fishPos.Add(new Vector2((width / 2) - 122, (height / 2) - 45));
            fishVel = new List<Vector2>();
            fishVel.Add(new Vector2(-1.2f, 0.0f));
            fishVel.Add(new Vector2(2.6f, 0.0f));
            fishVel.Add(new Vector2(-1.8f, 0.0f));
            Backgrounds.Add(new TextureMap(Constants.content.Load<Texture2D>(".\\art\\menuscreenbackground_layer3"), 1, 1));
            Backgrounds.Add(new TextureMap(Constants.content.Load<Texture2D>(".\\art\\menuscreenbackground_layer2"), 1, 1));
            Backgrounds.Add(new TextureMap(Constants.content.Load<Texture2D>(".\\art\\menuscreenbackground_layer1"), 1, 1));
            fish.Add(new TextureMap(Constants.content.Load<Texture2D>(".\\art\\fish1"), 1, 1, true));
            fish.Add(new TextureMap(Constants.content.Load<Texture2D>(".\\art\\fish2"), 1, 1, false));
            fish.Add(new TextureMap(Constants.content.Load<Texture2D>(".\\art\\fish3"), 1, 1, true));

            clouds = new List<TextureMap>();
            cloudPos = new List<Vector2>();
            cloudPos.Add(new Vector2((width / 2) - 320, height - (height - 32)));
            cloudPos.Add(new Vector2((width / 2) + 40, height - (height - 39)));
            cloudPos.Add(new Vector2((width / 2) + 340, height - (height - 28)));
            clouds.Add(new TextureMap(Constants.content.Load<Texture2D>(".\\art\\cloud1"), 1, 1, true));
            clouds.Add(new TextureMap(Constants.content.Load<Texture2D>(".\\art\\cloud2"), 1, 1, false));
            clouds.Add(new TextureMap(Constants.content.Load<Texture2D>(".\\art\\cloud3"), 1, 1, true));

            radioPos = new Vector2(374.0f, 58.0f);
            radio = new Animation(new AnimatedSprite(Constants.content.Load<Texture2D>(".\\art\\music_anim"), 1, 5, 600), radioPos);
            Constants.mAnimationManager.addAnimation(radio);

            DrawableEntities = new List<GameEntity>();
            _Menu = new Menu(ref sb);
            this._Menu.addButtons(b);
        }