ScreenSurfaceRenderer Class
Definition
Section titled “Definition”Draws a IScreenSurface.
public class ScreenSurfaceRenderer : 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”ScreenSurfaceRenderer()
Section titled “ScreenSurfaceRenderer()”Creates a new instance of this renderer with the default steps.
public ScreenSurfaceRenderer()Fields
Section titled “Fields”_renderTexture
Section titled “_renderTexture”The final texture steps are drawing on.
protected GameTexture _renderTexture_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 _finalDrawColordisposedValue
Section titled “disposedValue”Detects redundant calls.
protected bool disposedValueProperties
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; }The render steps for the renderer.
public List<IRenderStep> Steps { get; set; }CachedRenderRects
Section titled “CachedRenderRects”Cached set of rectangles used in rendering each cell.
public Rectangle[] CachedRenderRects { get; protected set; }Methods
Section titled “Methods”Refresh(IScreenSurface, bool)
Section titled “Refresh(IScreenSurface, bool)”Refreshes a cached drawing state.
public virtual 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 virtual void Render(IScreenSurface screen)Parameters
Section titled “Parameters”screen IScreenSurface
AddDefaultSteps()
Section titled “AddDefaultSteps()”Adds the render steps this renderer uses.
protected virtual void AddDefaultSteps()Dispose(bool)
Section titled “Dispose(bool)”Release the backing texture and the render texture target.
protected virtual void Dispose(bool disposing)Parameters
Section titled “Parameters”disposing bool
Indicates that the managed resources should be cleaned up.
~ScreenSurfaceRenderer()
Section titled “~ScreenSurfaceRenderer()”Disposes the object.
protected ~ScreenSurfaceRenderer()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