protected override void LoadContent() { batch = new SpriteBatch(GraphicsDevice); pix = Content.Load <Texture2D>("Pixel"); DebugSpriteBatch.Load(pix); DrawHelper.Pixel = pix; }
protected override void Initialize() { base.Initialize(); cam = new Camera(GraphicsDevice.Viewport); DebugSpriteBatch.Initialize(); w = new MyWorld(cam); w.Load(@".\Content\Level\Maps\map.xml", GraphicsDevice); cam.Follow = w.npcs[0]; DialogManager.Load(@".\Content\Level\Dialogs\dialog.xml"); debug = false; //foronoi = new Voronoi(new Index2(50, 70), new Index2(700, 60), new Index2(560, 790), new Index2(60, 700)); }
protected override void Draw(GameTime time) { GraphicsDevice.Clear(new Color(0.1f, 0.15f, 0.15f)); // new Color(51, 51, 51)); batch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, null, null, null, null, cam.Tranform); w.map.Draw(batch, cam.Tranform); //batch.End(); //batch.Begin(SpriteSortMode.Deferred, new BlendState() //{ // ColorSourceBlend = Blend.DestinationColor, // ColorDestinationBlend = Blend.Zero, // ColorBlendFunction = BlendFunction.Add //}, null, null, null, null, cam.Tranform); //w.map.Lightmap.Draw(batch); if (debug) { batch.End(); batch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, null, null, null, null, cam.Tranform); DebugSpriteBatch.Draw(batch); } batch.End(); //batch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, null, null, null, null, null); //foreach (var area in a) //{ // Color c = random.NextColor(); // foreach (var p in area.All) // { // batch.DrawIndex2(p, c); // } //} //batch.End(); base.Draw(time); }