Skip to content
PonySchreck edited this page Oct 21, 2016 · 13 revisions

Quad

##Short-Info The Quad is THE fancy class on which the COMPLETE 2D-Engine is based on. It includes the positions of the Quad, the UV coordinates, the color and also a pointer to the Texture.

##Function The Quad is rendered in coordinates of our coordinate-system. The coordinate or the 3-dimensional Vector m_Position0 is located left at the bottom of the Quad. The Z coordinate of this Vector is to tell the Renderer which quad is to be rendered first.

##How do I use it?

Normally, you do not need to create a quad, because the objects that you will need are all inherited from Quad. But if you still want to create a quad, you can do it like this:

Quad(Vector3f position, Vector2f size, uint color, Texture* tex)

Quad(Vector3f position, Vector2f size, uint color, Texture* tex, Vector2f uvposition, Vector2f uvsize)

  • position is handed over to m_position0.
  • m_position1 is calculated by adding the size to m_position0.
  • color is handed over to m_color
  • The Texture is set with the pointer to the Texture.

Or just create an empty Quad with the constructor Quad(). To modify your Quad use the Get and Set methods which are shown in the diagram.

Clone this wiki locally