OptimizedScreenSurfaceRenderer Class
Definition
Section titled “Definition”Draws a IScreenSurface with tint. Doesn’t allow render steps.
public sealed class OptimizedScreenSurfaceRenderer : IRenderer, IDisposable, IRendererMonoGameInheritance object
Implements IRenderer, IDisposable, IRendererMonoGame
Remarks
Section titled “Remarks”This renderer caches the entire drawing of the surface’s cells, including the tint of the object.
Constructors
Section titled “Constructors”OptimizedScreenSurfaceRenderer()
Section titled “OptimizedScreenSurfaceRenderer()”Creates a new instance of this renderer with the default steps.
public OptimizedScreenSurfaceRenderer()Fields
Section titled “Fields”_backingTexture
Section titled “_backingTexture”Quick access to backing texture.
public RenderTarget2D _backingTexture_finalDrawColor
Section titled “_finalDrawColor”Color used with drawing the texture to the screen. Let’s a surface become transparent.
public Color _finalDrawColorProperties
Section titled “Properties”The name used to create the renderer from the host.
public string Name { get; set; }Output
Section titled “Output”The cached texture of the drawn surface.
public ITexture Output { get; }MonoGameBlendState
Section titled “MonoGameBlendState”The blend state used by this renderer.
public BlendState MonoGameBlendState { get; set; }BackingTextureUsageMode
Section titled “BackingTextureUsageMode”Used when creating the _backingTexture variable.
public RenderTargetUsage BackingTextureUsageMode { get; set; }Opacity
Section titled “Opacity”A 0 to 255 value representing how transparent the surface is when it’s drawn to the screen. 255 represents full visibility.
public byte Opacity { get; set; }IsForced
Section titled “IsForced”true when the renderer is being forced to be redrawn this frame; otherwise false.
public bool IsForced { get; set; }CachedRenderRects
Section titled “CachedRenderRects”Cached set of rectangles used in rendering each cell.
public Rectangle[] CachedRenderRects { get; }Methods
Section titled “Methods”Refresh(IScreenSurface, bool)
Section titled “Refresh(IScreenSurface, bool)”Refreshes a cached drawing state.
public void Refresh(IScreenSurface screen, bool force = false)Parameters
Section titled “Parameters”screen IScreenSurface
force bool
When true, indicates the refresh should happen even if a surface isn’t dirty.
Render(IScreenSurface)
Section titled “Render(IScreenSurface)”Creates a drawcall in the drawing pipeline.
public void Render(IScreenSurface screen)Parameters
Section titled “Parameters”screen IScreenSurface
~OptimizedScreenSurfaceRenderer()
Section titled “~OptimizedScreenSurfaceRenderer()”Disposes the object.
protected ~OptimizedScreenSurfaceRenderer()Dispose()
Section titled “Dispose()”public void Dispose()Events
Section titled “Events”BackingTextureRecreated
Section titled “BackingTextureRecreated”Raised when the _backingTexture is recreated.
public event EventHandler BackingTextureRecreated