MeshDrawer2D

class MeshDrawer2D

Bases: TypedObject

This class allows the drawing of 2D objects - mainly based on quads and rectangles. It allows clipping and several high level UI theme functions.

Inheritance diagram

Inheritance diagram of MeshDrawer2D

MeshDrawer2D(void)

Creates the MeshDrawer2D low level system.

void begin(void)

Opens up the geom for drawing, don’t forget to call MeshDrawer2D::end()

void end(void)

Finish the drawing and clearing off the remaining vertexes.

int get_budget(void)

Gets the total triangle budget of the drawer.

static TypeHandle get_class_type(void)
NodePath get_root(void)

Returns the root NodePath.

void quad_raw(LVector3 const &v1, LVector4 const &c1, LVector2 const &uv1, LVector3 const &v2, LVector4 const &c2, LVector2 const &uv2, LVector3 const &v3, LVector4 const &c3, LVector2 const &uv3, LVector3 const &v4, LVector4 const &c4, LVector2 const &uv4)

Draws a 2D rectangle. Ignores the clipping rectangle.

void rectangle(PN_stdfloat x, PN_stdfloat y, PN_stdfloat w, PN_stdfloat h, PN_stdfloat u, PN_stdfloat v, PN_stdfloat us, PN_stdfloat vs, LVector4 const &color)

Draws a 2D rectangle which can be clipped.

void rectangle_border(PN_stdfloat x, PN_stdfloat y, PN_stdfloat w, PN_stdfloat h, PN_stdfloat r, PN_stdfloat t, PN_stdfloat l, PN_stdfloat b, PN_stdfloat tr, PN_stdfloat tt, PN_stdfloat tl, PN_stdfloat tb, PN_stdfloat u, PN_stdfloat v, PN_stdfloat us, PN_stdfloat vs, LVector4 const &color)

Draws a 2d rectangle, with borders and corders, taken from the surrounding texture

void rectangle_border_tiled(PN_stdfloat x, PN_stdfloat y, PN_stdfloat w, PN_stdfloat h, PN_stdfloat r, PN_stdfloat t, PN_stdfloat l, PN_stdfloat b, PN_stdfloat tr, PN_stdfloat tt, PN_stdfloat tl, PN_stdfloat tb, PN_stdfloat u, PN_stdfloat v, PN_stdfloat us, PN_stdfloat vs, LVector4 const &color)

Draws a 2d rectangle, with borders and corders, taken from the surrounding texture

void rectangle_raw(PN_stdfloat x, PN_stdfloat y, PN_stdfloat w, PN_stdfloat h, PN_stdfloat u, PN_stdfloat v, PN_stdfloat us, PN_stdfloat vs, LVector4 const &color)
void rectangle_tiled(PN_stdfloat x, PN_stdfloat y, PN_stdfloat w, PN_stdfloat h, PN_stdfloat u, PN_stdfloat v, PN_stdfloat us, PN_stdfloat vs, LVector4 const &color)

Draws a tiled rectangle, size of tiles is in us and vs

void set_budget(int budget)

Sets the total triangle budget of the drawer.

void set_clip(PN_stdfloat x, PN_stdfloat y, PN_stdfloat w, PN_stdfloat h)

Sets the clipping rectangle.