Пример #1
0
        internal void LoadContent()
        {
            spriteBatch = new SpriteBatch(Game.Instance.GraphicsDevice);

            background = Game.Instance.ContentManager.Load <Texture2D>("Sprites/Menu/background");

            mainMenu              = new MainMenu(this);
            LevelMenu             = new LevelMenu(this);
            SettingsMenu          = new SettingsMenu(this);
            HelpMenu              = new HelpMenu(this);
            CreditsMenuPage1      = new CreditsMenuPage1(this);
            CreditsMenuPage2      = new CreditsMenuPage2(this);
            PlayerMenu            = new PlayerMenu(this, LevelMenu);
            releaseNotesMenu      = new ReleaseNotesMenu(this);
            StaticStringFont      = Game.Instance.ContentManager.Load <SpriteFont>("Fonts/menu_releasenotes");
            StaticStringFontSmall = Game.Instance.ContentManager.Load <SpriteFont>("Fonts/menu_releasenotes_small");
        }
Пример #2
0
        public PlayerMenu(Menu menu, LevelMenu levelMenu)
            : base(menu, new Vector2(640, 160))
        {
            this.levelMenu = levelMenu;

            playerBackgroundInactive = Game.Instance.ContentManager.Load <Texture2D>("Sprites/Menu/robot_selection_background_inactive");

            DrawPrevious = false;

            // initialize walking player hack
            Effect clonedEffect = Game.Instance.ContentManager.Load <Effect>("Effects/Basic/Basic").Clone();

            playerModel = Game.Instance.ContentManager.Load <MagmaModel>("Models/Player/robot_grp").XnaModel;
            playerMesh  = playerModel.Meshes[0];
            foreach (ModelMeshPart meshPart in playerMesh.MeshParts)
            {
                Effect oldEffect = meshPart.Effect;
                meshPart.Effect = clonedEffect;
                oldEffect.Dispose();
            }
            animator       = new ModelAnimator(playerModel);
            walkController = new AnimationController(Game.Instance, animator.Animations["walk"]);
            Game.Instance.Components.RemoveAt(Game.Instance.Components.Count - 1);
            foreach (BonePose p in animator.BonePoses)
            {
                p.CurrentController      = walkController;
                p.CurrentBlendController = null;
                p.BlendFactor            = 0.0f;
            }

            playerPreview = new RenderTarget2D[MaxPlayers];
            for (int i = 0; i < MaxPlayers; ++i)
            {
                playerPreview[i] = new RenderTarget2D(Game.Instance.GraphicsDevice, 445, 445, false,
                                                      Game.Instance.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24Stencil8);
            }

            playerTexture   = Game.Instance.ContentManager.Load <Texture2D>("Textures/Player/Robot_texture10");
            specularTexture = Game.Instance.ContentManager.Load <Texture2D>("Textures/Player/robot_spec");

            playerBoxSize = new SineFloat(0.96f, 1.0f, 8.0f);
            playerBoxSize.Start(0.001f);
        }