Skip to content

DrawImage Class

Draws an image on top of a console.

C#
public class DrawImage : RenderComponent, IComponent, IDisposable

Inheritance objectRenderComponent

Implements IComponent, IDisposable

Creates a new component with the specified image.

C#
public DrawImage(string filePath)

filePath string
Relative path to the image.

Creates a new component with the specified image.

C#
public DrawImage(Texture2D texture)

texture Microsoft.Xna.Framework.Graphics.Texture2D
The texture to use

Sets or gets how the PositionOffset property is interpreted.

C#
public DrawImage.PositionModes PositionMode { get; set; }

The positioning offset.

C#
public Point PositionOffset { get; set; }

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.

Calls Dispose().

C#
protected ~DrawImage()

Called when the component is added to a host.

C#
public override void OnAdded(IScreenObject host)

host IScreenObject
The host that added the component.

Called when the component is removed from the host.

C#
public override void OnRemoved(IScreenObject host)

host IScreenObject
The host that removed the component.

Draws the image.

C#
public override void Render(IScreenObject host, TimeSpan delta)

host IScreenObject
The host of the component.

delta TimeSpan
Unused.

Disposes the image.

C#
public void Dispose()