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(); }
public void Draw(Renderer2D renderer) { renderer.BeginScene(camera.get_transformation()); foreach (Entity e in entities) { renderer.DrawEntity(e); } renderer.DrawEntity(player); renderer.EndScene(); }
public void Draw(Renderer2D renderer) { renderer.BeginScene(Matrix.Identity); renderer.DrawText("FPS: " + framesPerSecond , new Vector2(50, 50)); renderer.EndScene(); }
/// <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(); }