Ejemplo n.º 1
0
 public void Draw(Renderer2D renderer)
 {
     renderer.BeginScene(currLevel.Camera.get_transformation());
     renderer.DrawEntity(top);
     renderer.DrawEntity(left);
     renderer.DrawEntity(bottom);
     renderer.DrawEntity(right);
     renderer.EndScene();
 }
Ejemplo n.º 2
0
 public void Draw(Renderer2D renderer)
 {
     renderer.BeginScene(camera.get_transformation());
     foreach (Entity e in entities)
     {
         renderer.DrawEntity(e);
     }
     renderer.DrawEntity(player);
     renderer.EndScene();
 }
Ejemplo n.º 3
0
 public void Draw(Renderer2D renderer)
 {
     renderer.BeginScene(Matrix.Identity);
     renderer.DrawText("FPS: " + framesPerSecond , new Vector2(50, 50));
     renderer.EndScene();
 }
Ejemplo n.º 4
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);
            renderer = new Renderer2D(GraphicsDevice);
            renderer.TextFont = Content.Load<SpriteFont>("default_font");

            Texture2D texture = new Texture2D(GraphicsDevice, 1, 1);
            texture.SetData(new Color[] { Color.White });
            Entity.SetDefaultTexture(texture);

            level = TestLevelBuilder.buildTestLevel(texture);
            Camera camera = new Camera(GraphicsDevice.Viewport);
            camera.Pos = new Vector2(400, 250);
            level.Camera = camera;
            editor = new Editor();
            editor.CurrentLevel = level;

            fps = new FPSCounter();
        }