Esempio n. 1
0
 public EditorScreen(Game game)
     : base(game)
 {
     physicsSim = new PhysicsSimulator(new Vector2(0f, 1.0f));
     entityManager = new EntityManager();
     guiManager = new GUIManager();
     simView = new PhysicsSimulatorView(physicsSim);
     simView.LoadContent(Game.GraphicsDevice, Game.Content);
     //Build UI
     GUITextButton exitBtn = new GUITextButton(game, "BTN_EXIT", "POP", "Exit", 10, 10);
     guiManager.addObject(exitBtn);
 }
Esempio n. 2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
            knight.LoadContent(physicsSimulator, Content);
            level.Build("level.xml", physicsSimulator, Content);

            bodyCamera = BodyFactory.Instance.CreateBody(physicsSimulator, 1f, 1f);
            bodyCamera.IgnoreGravity = true;
            camera = new Camera2D(new Vector2(GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height));
            camera.TrackingBody = bodyCamera;
            camera.Zoom = .25f;

            psView = new PhysicsSimulatorView(physicsSimulator);
            psView.LoadContent(GraphicsDevice, Content);
        }
 protected override void LoadContent()
 {
     debugBatch = new SpriteBatch(GraphicsDevice);
     debugView.LoadContent(GraphicsDevice, Game.Content);
     base.LoadContent();
 }