interface Tinman.Engine.Application.IRenderable2D

Base interface for classes that perform 2D rendering.

Public / Methods


public method Render2D → (1)

in : Graphics

The graphics object to use. If this class also implements the IGraphicsComponent interface, this Graphics object will usually be the same as the one that has been passed to IGraphicsComponent.GraphicsAttach. However, an implementation must not assume that this is always the case.

Performs 2D rendering.

When this method is called, the given Graphics object has already been initialized for 2D rendering:

  • The render bounds have been specified (see Graphics.Bounds).

  • The IBeginEnd.Begin method has already been called.

  • Clipping and translation have been applied, so that (0|0) refers to the top-left pixel of the target rectangle and Graphics.ScreenSize returns the target rectangle size. The target rectangle and the clipping rectangle can be different.

In general, the Render2D and IRenderable.Render methods are independent and must be called separately. Only some top-level components invoke Render2D from within their implementation of IRenderable.Render. In this case, the documentation will state this fact.