Skip to content

4D8F45FE

Marcel Härtel edited this page Aug 27, 2023 · 2 revisions

BeginAntialising Method

Everything between BeginAntialising() and EndAntialising() will be affected by MSAA.

Definition

Namespace: MonoGame.Forms.NET.Services
Assembly: MonoGame.Forms.NET (in MonoGame.Forms.NET.dll) Version: 3.2.0

C#

public void BeginAntialising(
	bool clearGraphics = true,
	Color? clearColor = null,
	ClearOptions clearOptions = ClearOptions.Target|ClearOptions.DepthBuffer|ClearOptions.Stencil,
	float depth = 1f,
	int stencil = 0
)

Parameters

  Boolean  (Optional)
false if you don't want to to call GraphicsDevice.Clear() after setting the RenderTarget2D.
  Nullable(Color)  (Optional)
The Color to be used to clear the GraphicsDevice after setting the RenderTarget2D.
  ClearOptions  (Optional)
Define your custom ClearOptions.
  Single  (Optional)
The depth.
  Int32  (Optional)
The stencil

Example

C#

protected override void Draw()
{
   base.Draw();

   Editor.BeginAntialising();

   Editor.spriteBatch.Begin();

   //Your drawings

   Editor.spriteBatch.End();

   Editor.EndAntialising();
}

See Also

Reference

EditorService Class
MonoGame.Forms.NET.Services Namespace

Clone this wiki locally