Skip to main content
Version: 1.0.0-preview.33

Velaptor.Graphics.Renderers.ILineRenderer

Velaptor

Velaptor.Graphics.Renderers

ILineRenderer Interface

Renders lines to the screen.

public interface ILineRenderer

Methods

Render(Line, int)

Renders the given line.

void Render(Velaptor.Graphics.Line line, int layer=0);

Parameters

line Line

The line to render.

layer System.Int32

The layer to render the line.

Exceptions

System.Exception
Thrown if the Begin() method has not been called.

Remarks

Lower layer values will render before higher layer values.
If two separate textures have the same layer value, they will
render in the order that the method was invoked.

Example below:Render Method Invoked Order:

  1. Texture 1 (Layer -10)
  2. Texture 2 (Layer -20)
  3. Texture 3 (Layer 0)
  4. Texture 4 (Layer 0)
  5. Texture 5 (Layer 4)
  6. Texture 6 (Layer 3)Texture Render Order:
  • Texture 2
  • Texture 1
  • Texture 3
  • Texture 4
  • Texture 6
  • Texture 5

RenderLine(Vector2, Vector2, int)

Renders a line using the given start and end vectors on the given layer.

void RenderLine(System.Numerics.Vector2 start, System.Numerics.Vector2 end, int layer=0);

Parameters

start System.Numerics.Vector2

The start of the line.

end System.Numerics.Vector2

The end of the line.

layer System.Int32

The layer to render the line.

Exceptions

System.Exception
Thrown if the Begin() method has not been called.

Remarks

Lower layer values will render before higher layer values.
If two separate textures have the same layer value, they will
render in the order that the method was invoked.

Example below:Render Method Invoked Order:

  1. Texture 1 (Layer -10)
  2. Texture 2 (Layer -20)
  3. Texture 3 (Layer 0)
  4. Texture 4 (Layer 0)
  5. Texture 5 (Layer 4)
  6. Texture 6 (Layer 3)Texture Render Order:
  • Texture 2
  • Texture 1
  • Texture 3
  • Texture 4
  • Texture 6
  • Texture 5

RenderLine(Vector2, Vector2, Color, int)

Renders a line using the given start and end vectors on the given layer
using the given color.

void RenderLine(System.Numerics.Vector2 start, System.Numerics.Vector2 end, System.Drawing.Color color, int layer=0);

Parameters

start System.Numerics.Vector2

The start of the line.

end System.Numerics.Vector2

The end of the line.

color System.Drawing.Color

The color of the line.

layer System.Int32

The layer to render the line.

Exceptions

System.Exception
Thrown if the Begin() method has not been called.

Remarks

Lower layer values will render before higher layer values.
If two separate textures have the same layer value, they will
render in the order that the method was invoked.

Example below:Render Method Invoked Order:

  1. Texture 1 (Layer -10)
  2. Texture 2 (Layer -20)
  3. Texture 3 (Layer 0)
  4. Texture 4 (Layer 0)
  5. Texture 5 (Layer 4)
  6. Texture 6 (Layer 3)Texture Render Order:
  • Texture 2
  • Texture 1
  • Texture 3
  • Texture 4
  • Texture 6
  • Texture 5

RenderLine(Vector2, Vector2, Color, uint, int)

Renders a line using the given start and end vectors on the given layer
using the given color and line thickness.

void RenderLine(System.Numerics.Vector2 start, System.Numerics.Vector2 end, System.Drawing.Color color, uint thickness, int layer=0);

Parameters

start System.Numerics.Vector2

The start of the line.

end System.Numerics.Vector2

The end of the line.

color System.Drawing.Color

The color of the line.

thickness System.UInt32

The thickness of the line.

layer System.Int32

The layer to render the line.

Exceptions

System.Exception
Thrown if the Begin() method has not been called.

Remarks

Lower layer values will render before higher layer values.
If two separate textures have the same layer value, they will
render in the order that the method was invoked.

Example below:Render Method Invoked Order:

  1. Texture 1 (Layer -10)
  2. Texture 2 (Layer -20)
  3. Texture 3 (Layer 0)
  4. Texture 4 (Layer 0)
  5. Texture 5 (Layer 4)
  6. Texture 6 (Layer 3)Texture Render Order:
  • Texture 2
  • Texture 1
  • Texture 3
  • Texture 4
  • Texture 6
  • Texture 5

RenderLine(Vector2, Vector2, uint, int)

Renders a line using the given start and end vectors on the given layer
using the given line thickness.

void RenderLine(System.Numerics.Vector2 start, System.Numerics.Vector2 end, uint thickness, int layer=0);

Parameters

start System.Numerics.Vector2

The start of the line.

end System.Numerics.Vector2

The end of the line.

thickness System.UInt32

The thickness of the line.

layer System.Int32

The layer to render the line.

Exceptions

System.Exception
Thrown if the Begin() method has not been called.

Remarks

Lower layer values will render before higher layer values.
If two separate textures have the same layer value, they will
render in the order that the method was invoked.

Example below:Render Method Invoked Order:

  1. Texture 1 (Layer -10)
  2. Texture 2 (Layer -20)
  3. Texture 3 (Layer 0)
  4. Texture 4 (Layer 0)
  5. Texture 5 (Layer 4)
  6. Texture 6 (Layer 3)Texture Render Order:
  • Texture 2
  • Texture 1
  • Texture 3
  • Texture 4
  • Texture 6
  • Texture 5