public void DrawToFBO(MicroWorld.Graphics.Renderer renderer) { var p = parent as Frame; renderer.EnableFBO(p.fbo); renderer.GraphicsDevice.Clear(Color.Transparent); var s = Settings.GameScale; Settings.GameScale = MicroWorld.Graphics.Camera.ZOOM_MAX; var t = Shortcuts.camera.Center; var a = Shortcuts.camera.VisibleRectangle; Shortcuts.camera.Center = Position + new Vector2(a.Width / 2, a.Height / 2); renderer.Begin(); DrawFrame((int)Position.X, (int)Position.Y, (int)(Position.X + Size.X), (int)(Position.Y + Size.Y), renderer, 1f, true); for (int i = 0; i < p.containsComponents.Length; i++) { if (!renderer.IsDrawing) renderer.Begin(); p.containsComponents[i].Graphics.IgnoreNextDraw = true; p.containsComponents[i].Graphics.Draw(renderer); } renderer.End(); Shortcuts.camera.Center = t; Settings.GameScale = s; renderer.DisableFBO(); }
public void DrawToFBO(MicroWorld.Graphics.Renderer renderer) { var p = parent as Blocker; renderer.EnableFBO(p.fbo); renderer.GraphicsDevice.Clear(Color.Transparent); renderer.BeginUnscaled(); renderer.Draw(bg, new Rectangle(0, 0, (int)Size.X * 4, (int)Size.Y * 4), new Rectangle(0, 0, (int)Size.X * 4, (int)Size.Y * 4), Color.White); renderer.Draw(Shortcuts.pixel, new Rectangle(0, 0, 2, (int)Size.Y * 4), Color.White); renderer.Draw(Shortcuts.pixel, new Rectangle(0, 0, (int)Size.X * 4, 2), Color.White); renderer.Draw(Shortcuts.pixel, new Rectangle((int)Size.X * 4 - 2, 0, 2, (int)Size.Y * 4), Color.White); renderer.Draw(Shortcuts.pixel, new Rectangle(0, (int)Size.Y * 4 - 2, (int)Size.X * 4, 2), Color.White); renderer.End(); renderer.DisableFBO(); }