示例#1
0
        // My alternative to LoadContent; makes progress bars easier
        protected override ContentManager Load()
        {
            ContentManager c = new ContentManager();

            c.AddTask(new LoadTask("effects", delegate()
            {
                _effectBlackout  = Content.Load <Effect>("fx/effect_blackout");
                _effectGreyscale = Content.Load <Effect>("fx/effect_greyscale");
                _effectGreyscale.Parameters["lightness"].SetValue(0f);
            }));

            c.AddTask(new LoadTask("physics", delegate()
            {
                TouchPanel.EnabledGestures = GestureType.Tap | GestureType.FreeDrag | GestureType.DragComplete;
                ConvertUnits.SetDisplayUnitToSimUnitRatio(10f);

                _world = new World(new Vector2(0, 9.98f));

                _hand        = new Hand(_world, Content, new Vector2(0, 26));
                _baseballBat = new BaseballBat(_world, Content, new Vector2(0, -24));

                Camera = new View.Camera(this, new Vector2(0, 0), 1f);
            }));

            return(c);
        }