Skip to content

SurfaceViewer Class

Draws a ICellSurface within an area. Optionally supports scroll bars.

C#
[DataContract]
public class SurfaceViewer : CompositeControl, IContainer, IList<ControlBase>, ICollection<ControlBase>, IEnumerable<ControlBase>, IEnumerable

Inheritance objectControlBaseCompositeControl

Implements IContainer, IList<ControlBase>, ICollection<ControlBase>, IEnumerable<ControlBase>, IEnumerable

Creates a new drawing surface control with the specified width and height.

C#
public SurfaceViewer(int width, int height, ICellSurface? surface = null)

width int
Width of the control.

height int
Height of the control.

surface ICellSurface
The surface to view.

The horizontal scroll bar. This shouldn’t be changed.

C#
public ScrollBar HorizontalScroller

The vertical scroll bar. This shouldn’t be changed.

C#
public ScrollBar VerticalScroller

Sets the visual behavior of the scroll bars for the control.

C#
[DataMember]
public SurfaceViewer.ScrollBarModes ScrollBarMode { get; set; }

Resets the control’s surface to a 1x1 surface transparent surface.

C#
public void ResetSurface()

OnSurfaceChanged(ICellSurface, ICellSurface)

Section titled “OnSurfaceChanged(ICellSurface, ICellSurface)”

Handles and dehandles the IsDirtyChanged event for the backing surface.

C#
protected override void OnSurfaceChanged(ICellSurface oldSurface, ICellSurface newSurface)

oldSurface ICellSurface
The previous surface instance.

newSurface ICellSurface
The new surface instance.

Updates each control hosted by this control.

C#
public override void UpdateAndRedraw(TimeSpan time)

time TimeSpan
The game frame time delta.