DrawImage Class
Definition
Section titled “Definition”Draws an image on top of a console.
public class DrawImage : RenderComponent, IComponent, IDisposableInheritance object → RenderComponent
Implements IComponent, IDisposable
Constructors
Section titled “Constructors”DrawImage(string)
Section titled “DrawImage(string)”Creates a new component with the specified image.
public DrawImage(string filePath)Parameters
Section titled “Parameters”filePath string
Relative path to the image.
DrawImage(Texture2D)
Section titled “DrawImage(Texture2D)”Creates a new component with the specified image.
public DrawImage(Texture2D texture)Parameters
Section titled “Parameters”texture Microsoft.Xna.Framework.Graphics.Texture2D
The texture to use
Properties
Section titled “Properties”PositionMode
Section titled “PositionMode”Sets or gets how the PositionOffset property is interpreted.
public DrawImage.PositionModes PositionMode { get; set; }PositionOffset
Section titled “PositionOffset”The positioning offset.
public Point PositionOffset { get; set; }Remarks
Section titled “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
Section titled “Methods”~DrawImage()
Section titled “~DrawImage()”Calls Dispose().
protected ~DrawImage()OnAdded(IScreenObject)
Section titled “OnAdded(IScreenObject)”Called when the component is added to a host.
public override void OnAdded(IScreenObject host)Parameters
Section titled “Parameters”host IScreenObject
The host that added the component.
OnRemoved(IScreenObject)
Section titled “OnRemoved(IScreenObject)”Called when the component is removed from the host.
public override void OnRemoved(IScreenObject host)Parameters
Section titled “Parameters”host IScreenObject
The host that removed the component.
Render(IScreenObject, TimeSpan)
Section titled “Render(IScreenObject, TimeSpan)”Draws the image.
public override void Render(IScreenObject host, TimeSpan delta)Parameters
Section titled “Parameters”host IScreenObject
The host of the component.
delta TimeSpan
Unused.
Dispose()
Section titled “Dispose()”Disposes the image.
public void Dispose()