public void DrawLights() { Game1.SpriteBatchGlobal.Begin(SpriteSortMode.Immediate, BlendState.Additive, SamplerState.PointClamp, transformMatrix: Camera2DEditor.GetViewMatrix()); foreach (IProjectile prjctl in MapProjectiles) { prjctl.DrawLight(); } foreach (ITriggers trgr in mapTriggers) { trgr.DrawLight(); } foreach (IEffect lght in mapLightings) { lght.DrawLight(); } foreach (IDecoration dcr in mapDecorations) { dcr.DrawLight(); } foreach (IParticle prtcl in mapParticles) { prtcl.DrawLight(); } foreach (IPickable pck in mapPickables) { pck.DrawLight(); } Game1.SpriteBatchGlobal.End(); }
public static void DrawEditor() { Game1.GraphicsGlobal.GraphicsDevice.SetRenderTargets(Game1.EditorBackground); Game1.SpriteBatchGlobal.Begin(samplerState: SamplerState.PointWrap, blendState: BlendState.AlphaBlend, sortMode: SpriteSortMode.Immediate, transformMatrix: Camera2DEditor.GetViewMatrix()); Game1.SpriteBatchGlobal.Draw(Game1.Textures["BackgroundEditor"], Vector2.Zero, sourceRectangle: new Rectangle(0, 0, (int)Editor.EditMap.MapBoundary.Size.X, (int)Editor.EditMap.MapBoundary.Size.Y)); Editor.EditMap.Draw(); Editor.DrawEntityCursor(); Game1.SpriteBatchGlobal.End(); Game1.SpriteBatchGlobal.Begin(); foreach (UIInformer info in Game1.InfoList.Reverse <UIInformer>()) { info.Position = new Vector2(8, Game1.InfoList.IndexOf(info) * 32 + 8); info.Draw(); } Game1.SpriteBatchGlobal.End(); }