Show / Hide Table of Contents

Class DrawImage

Draws an image on top of a console.

Inheritance
object
RenderComponent
DrawImage
Implements
IComponent
IDisposable
Inherited Members
RenderComponent.SortOrder
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: SadConsole.Components
Assembly: SadConsole.Host.MonoGame.dll
Syntax
public class DrawImage : RenderComponent, IComponent, IDisposable

Constructors

DrawImage(Texture2D)

Creates a new component with the specified image.

Declaration
public DrawImage(Texture2D texture)
Parameters
Type Name Description
Texture2D texture

The texture to use

DrawImage(string)

Creates a new component with the specified image.

Declaration
public DrawImage(string filePath)
Parameters
Type Name Description
string filePath

Relative path to the image.

Properties

PositionMode

Sets or gets how the PositionOffset property is interpreted.

Declaration
public DrawImage.PositionModes PositionMode { get; set; }
Property Value
Type Description
DrawImage.PositionModes

PositionOffset

The positioning offset.

Declaration
public Point PositionOffset { get; set; }
Property Value
Type Description
Point
Remarks

The position the image is displayed is based on the hosting console's position. This property adjusts the position of the image by the specified amount.

Methods

Dispose()

Disposes the image.

Declaration
public void Dispose()

~DrawImage()

Calls Dispose().

Declaration
protected ~DrawImage()

OnAdded(IScreenObject)

Called when the component is added to a host.

Declaration
public override void OnAdded(IScreenObject host)
Parameters
Type Name Description
IScreenObject host

The host that added the component.

Overrides
RenderComponent.OnAdded(IScreenObject)

OnRemoved(IScreenObject)

Called when the component is removed from the host.

Declaration
public override void OnRemoved(IScreenObject host)
Parameters
Type Name Description
IScreenObject host

The host that removed the component.

Overrides
RenderComponent.OnRemoved(IScreenObject)

Render(IScreenObject, TimeSpan)

Draws the image.

Declaration
public override void Render(IScreenObject host, TimeSpan delta)
Parameters
Type Name Description
IScreenObject host

The host of the component.

TimeSpan delta

Unused.

Overrides
RenderComponent.Render(IScreenObject, TimeSpan)

Implements

IComponent
IDisposable

Extension Methods

ExtensionsSystem.GetDebuggerDisplayValue(object)
In this article

Back to top

Back to top Generated by DocFX