MeshDrawer2D

from panda3d.core import MeshDrawer2D
class MeshDrawer2D

Bases:

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

__init__()

Creates the MeshDrawer2D low level system.

begin()

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

end()

Finish the drawing and clearing off the remaining vertexes.

get_budget() int

Gets the total triangle budget of the drawer.

static get_class_type() TypeHandle
get_root() NodePath

Returns the root NodePath.

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

Draws a 2D rectangle. Ignores the clipping rectangle.

rectangle(x: float, y: float, w: float, h: float, u: float, v: float, us: float, vs: float, color: LVector4)

Draws a 2D rectangle which can be clipped.

rectangle_border(x: float, y: float, w: float, h: float, r: float, t: float, l: float, b: float, tr: float, tt: float, tl: float, tb: float, u: float, v: float, us: float, vs: float, color: LVector4)

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

rectangle_border_tiled(x: float, y: float, w: float, h: float, r: float, t: float, l: float, b: float, tr: float, tt: float, tl: float, tb: float, u: float, v: float, us: float, vs: float, color: LVector4)

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

rectangle_raw(x: float, y: float, w: float, h: float, u: float, v: float, us: float, vs: float, color: LVector4)
rectangle_tiled(x: float, y: float, w: float, h: float, u: float, v: float, us: float, vs: float, color: LVector4)

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

set_budget(budget: int)

Sets the total triangle budget of the drawer.

set_clip(x: float, y: float, w: float, h: float)

Sets the clipping rectangle.