Skip to main content
Version: Next

Velaptor.Graphics.Renderers.IShapeRenderer

Velaptor

Velaptor.Graphics.Renderers

IShapeRenderer Interface

Renders rectangles to the screen.

public interface IShapeRenderer

Methods

Render(CircleShape, int)

Renders the given circle.

void Render(Velaptor.Graphics.CircleShape circle, int layer=0);

Parameters

circle CircleShape

The circle to render.

layer System.Int32

The layer to render the circle.

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

Render(RectShape, int)

Renders the given rect.

void Render(Velaptor.Graphics.RectShape rect, int layer=0);

Parameters

rect RectShape

The rectangle to render.

layer System.Int32

The layer to render the rectangle.

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