MeshDrawer2D

from panda3d.core import 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

__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.

getBudget()int

Gets the total triangle budget of the drawer.

static getClassType()TypeHandle
getRoot()NodePath

Returns the root NodePath.

quadRaw(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.

rectangleBorder(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

rectangleBorderTiled(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

rectangleRaw(x: float, y: float, w: float, h: float, u: float, v: float, us: float, vs: float, color: LVector4)
rectangleTiled(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

setBudget(budget: int)

Sets the total triangle budget of the drawer.

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

Sets the clipping rectangle.