public override void Render() { var tex = new Texture(Draw.Width, Draw.Height); Draw.BeginTexture(tex); world.Render(); Draw.EndTexture(); Draw.Save(); Draw.Scale(2); Draw.Align(0.5, 0.5); //Draw.Color(0.5, 0.5, 0.5); tex.Render(); Draw.Color(1, 1, 1, 0.5); Draw.Quad(); Draw.Load(); base.Render(); Draw.Save(); new Camera(10).Apply(); buttons.Render(); Draw.Translate(new Vec2(0, 2) + Vec2.Rotate(Vec2.OrtX, App.Time) / 10); Draw.Scale(8, 1.5); Draw.Align(0.5, 0); logo.Render(); Draw.Load(); }
public void Render() { Draw.Save(); cam.Apply(); Draw.Save(); Draw.Translate(cam.Position); Draw.Scale(30); double aspect = (double)back.Width / back.Height; Draw.Scale(2); Draw.Scale(aspect, 1); Draw.Align(0.5, 0.5); const double k = 50; Draw.Color(0.5, 0.5, 0.5, 1); back.SubTexture(cam.Position.X / aspect / k, cam.Position.Y / k, 2, 2).Render(); Draw.Load(); foreach (var o in objects) { if (o is Cloud) { continue; } o.Render(); } Draw.BeginTexture(cloudMap); cam.Apply(); Draw.Clear(1, 1, 1, 0); foreach (var o in objects) { if (o is Cloud) { o.Render(); } } Draw.EndTexture(); Draw.Load(); Draw.Save(); new Camera(1).Apply(); Draw.Scale((double)cloudMap.Width / cloudMap.Height, 1); Draw.Align(0.5, 0.5); Draw.Color(1, 1, 1, 0.3); cloudMap.Render(); Draw.Load(); }
public override void Render() { if (tex == null || tex.Width != Draw.Width || tex.Height != Draw.Height) { tex = new Texture(Draw.Width, Draw.Height); } Draw.BeginTexture(tex); base.Render(); Draw.EndTexture(); tex.RemoveAlpha(); Draw.Save(); Draw.Scale(2); Draw.Align(0.5, 0.5); tex.Render(); if (back != null) { Draw.Color(1, 1, 1, t); back.Render(); } Draw.Load(); var cam = new Camera(20); Draw.Save(); cam.Apply(); Draw.Translate(cam.FromWH(Mouse.Position, Draw.Width, Draw.Height)); Draw.Align(0.5, 0.5); cursor.Render(); Draw.Load(); }