Skip to content

API Reference

mewnala

ALT = 342 module-attribute

BACKQUOTE = 96 module-attribute

BACKSLASH = 92 module-attribute

BACKSPACE = 259 module-attribute

BEVEL = 2 module-attribute

BRACKET_LEFT = 91 module-attribute

BRACKET_RIGHT = 93 module-attribute

CENTER = 1 module-attribute

CHORD = 1 module-attribute

CLOSE = True module-attribute

COMMA = 44 module-attribute

CONTROL = 341 module-attribute

CORNER = 0 module-attribute

CORNERS = 1 module-attribute

DEG_TO_RAD module-attribute

DELETE = 261 module-attribute

DOWN = 264 module-attribute

END = 269 module-attribute

ENTER = 257 module-attribute

EQUAL = 61 module-attribute

ESCAPE = 256 module-attribute

F1 = 290 module-attribute

F10 = 299 module-attribute

F11 = 300 module-attribute

F12 = 301 module-attribute

F2 = 291 module-attribute

F3 = 292 module-attribute

F4 = 293 module-attribute

F5 = 294 module-attribute

F6 = 295 module-attribute

F7 = 296 module-attribute

F8 = 297 module-attribute

F9 = 298 module-attribute

HALF_PI module-attribute

HOME = 268 module-attribute

HSL = 2 module-attribute

HSV = 3 module-attribute

HWB = 4 module-attribute

INSERT = 260 module-attribute

KEY_0 = 48 module-attribute

KEY_1 = 49 module-attribute

KEY_2 = 50 module-attribute

KEY_3 = 51 module-attribute

KEY_4 = 52 module-attribute

KEY_5 = 53 module-attribute

KEY_6 = 54 module-attribute

KEY_7 = 55 module-attribute

KEY_8 = 56 module-attribute

KEY_9 = 57 module-attribute

KEY_A = 65 module-attribute

KEY_B = 66 module-attribute

KEY_C = 67 module-attribute

KEY_D = 68 module-attribute

KEY_E = 69 module-attribute

KEY_F = 70 module-attribute

KEY_G = 71 module-attribute

KEY_H = 72 module-attribute

KEY_I = 73 module-attribute

KEY_J = 74 module-attribute

KEY_K = 75 module-attribute

KEY_L = 76 module-attribute

KEY_M = 77 module-attribute

KEY_N = 78 module-attribute

KEY_O = 79 module-attribute

KEY_P = 80 module-attribute

KEY_Q = 81 module-attribute

KEY_R = 82 module-attribute

KEY_S = 83 module-attribute

KEY_T = 84 module-attribute

KEY_U = 85 module-attribute

KEY_V = 86 module-attribute

KEY_W = 87 module-attribute

KEY_X = 88 module-attribute

KEY_Y = 89 module-attribute

KEY_Z = 90 module-attribute

LAB = 7 module-attribute

LCH = 8 module-attribute

LEFT = 0 module-attribute

LEFT_ARROW = 263 module-attribute

LINEAR = 1 module-attribute

LINES = 2 module-attribute

MINUS = 45 module-attribute

MITER = 1 module-attribute

OKLAB = 5 module-attribute

OKLCH = 6 module-attribute

OPEN = 0 module-attribute

PAGE_DOWN = 267 module-attribute

PAGE_UP = 266 module-attribute

PERIOD = 46 module-attribute

PI module-attribute

PIE = 2 module-attribute

POINTS = 1 module-attribute

POLYGON = 0 module-attribute

PROJECT = 2 module-attribute

QUADS = 6 module-attribute

QUAD_STRIP = 7 module-attribute

QUARTER_PI module-attribute

QUOTE = 39 module-attribute

RADIUS = 3 module-attribute

RAD_TO_DEG module-attribute

RIGHT = 2 module-attribute

RIGHT_ARROW = 262 module-attribute

ROUND = 0 module-attribute

SEMICOLON = 59 module-attribute

SHIFT = 340 module-attribute

SLASH = 47 module-attribute

SPACE = 32 module-attribute

SQUARE = 1 module-attribute

SRGB = 0 module-attribute

SUPER = 343 module-attribute

TAB = 258 module-attribute

TAU module-attribute

TRIANGLES = 3 module-attribute

TRIANGLE_FAN = 4 module-attribute

TRIANGLE_STRIP = 5 module-attribute

TWO_PI module-attribute

UP = 265 module-attribute

VecIter = _native_math.PyVecIter module-attribute

XYZ = 9 module-attribute

Attribute

named typed attribute. use the position()/color()/etc. classmethods for builtins or Attribute(name, format) for custom ones.

format property

name property

color() staticmethod

dead() staticmethod

normal() staticmethod

position() staticmethod

rotation() staticmethod

scale() staticmethod

uv() staticmethod

AttributeFormat

Float instance-attribute

Float2 instance-attribute

Float3 instance-attribute

Float4 instance-attribute

BlendMode

DST_ALPHA = 8 class-attribute instance-attribute

DST_COLOR = 6 class-attribute instance-attribute

ONE = 1 class-attribute instance-attribute

ONE_MINUS_DST_ALPHA = 9 class-attribute instance-attribute

ONE_MINUS_DST_COLOR = 7 class-attribute instance-attribute

ONE_MINUS_SRC_ALPHA = 5 class-attribute instance-attribute

ONE_MINUS_SRC_COLOR = 3 class-attribute instance-attribute

OP_ADD = 0 class-attribute instance-attribute

OP_MAX = 4 class-attribute instance-attribute

OP_MIN = 3 class-attribute instance-attribute

OP_REVERSE_SUBTRACT = 2 class-attribute instance-attribute

OP_SUBTRACT = 1 class-attribute instance-attribute

SRC_ALPHA = 4 class-attribute instance-attribute

SRC_ALPHA_SATURATED = 10 class-attribute instance-attribute

SRC_COLOR = 2 class-attribute instance-attribute

ZERO = 0 class-attribute instance-attribute

Buffer

read()

write(values)

Color

a property writable

b property writable

g property writable

r property writable

darker(amount)

distance(other)

distance_squared(other)

gray(lightness) staticmethod

hex(s) staticmethod

hsla(h, s, l, a=1.0) staticmethod

hsva(h, s, v, a=1.0) staticmethod

hue()

hwba(h, w, b, a=1.0) staticmethod

is_fully_opaque()

is_fully_transparent()

lab(l, a_axis, b_axis, alpha=1.0) staticmethod

lch(l, c, h, a=1.0) staticmethod

lerp(other, t)

lighter(amount)

linear(r, g, b, a=1.0) staticmethod

luminance()

mix(other, t)

oklab(l, a_axis, b_axis, alpha=1.0) staticmethod

oklch(l, c, h, a=1.0) staticmethod

rotate_hue(degrees)

saturation()

srgb(r, g, b, a=1.0) staticmethod

to_hex()

to_hsla()

to_hsva()

to_hwba()

to_lab()

to_lch()

to_linear()

to_list()

to_oklab()

to_oklch()

to_srgba()

to_tuple()

to_vec3()

to_vec4()

to_xyz()

with_alpha(a)

with_hue(hue)

with_luminance(value)

with_saturation(saturation)

xyz(x, y, z, a=1.0) staticmethod

Compute

dispatch(x, y, z)

set(**kwargs)

Font

metadata()

Query font metadata.

Returns a (family, style, weight, width, is_variable) tuple.

variations()

Query variable font axes.

Returns a list of (tag, min, max, default) tuples.

Geometry

box(width, height, depth) staticmethod

color(*args)

grid(nx, ny, nz, spacing=1.0) staticmethod

lattice centered at the origin; topology is PointList, intended as a position source for Particles(geometry=...) rather than rasterized.

index(i)

normal(*args)

set_vertex(i, *args)

sphere(radius, sectors=32, stacks=18) staticmethod

uv(*args)

vertex(*args)

vertex_count()

Gltf

camera(index)

geometry(name)

light(index)

material(name)

material_names()

mesh_names()

Graphics

focused property

height property

key property

key_code property

key_is_pressed property

mouse_button property

mouse_is_pressed property

mouse_wheel property

mouse_x property

mouse_y property

moved_x property

moved_y property

pixel_density property

pixel_height property

pixel_width property

pmouse_x property

pmouse_y property

width property

arc(cx, cy, w, h, start, stop, mode)

background(*args)

background_image(image)

begin_contour()

begin_draw()

begin_shape(kind)

bezier(x1, y1, x2, y2, x3, y3, x4, y4)

bezier_vertex(cx1, cy1, cx2, cy2, x, y)

blend_mode(mode)

camera_center(*args)

camera_distance(distance)

camera_look_at(*args)

camera_max_distance(max)

camera_min_distance(min)

camera_position(*args)

camera_reset()

camera_speed(speed)

circle(cx, cy, d)

clear_text_features()

clear_text_variations()

color(*args)

color_mode(mode, max1=None, max2=None, max3=None, max_alpha=None)

create_font(name)

create_image(width, height)

curve(x1, y1, x2, y2, x3, y3, x4, y4)

curve_vertex(x, y)

disable_camera()

draw_box(width, height, depth)

draw_capsule(radius, length, detail)

draw_cone(radius, height, detail)

draw_conical_frustum(radius_top, radius_bottom, height, detail)

draw_cylinder(radius, height, detail)

draw_geometry(geometry)

draw_plane(width, height)

draw_sphere(radius, sectors, stacks)

draw_tetrahedron(radius)

draw_torus(radius, tube_radius, major_segments, minor_segments)

ellipse(cx, cy, w, h)

ellipse_mode(mode)

emissive(*args)

end_contour()

end_draw()

end_shape(close)

fill(*args)

flush()

free_camera()

image(source, dx, dy, d_width=None, d_height=None, sx=None, sy=None, s_width=None, s_height=None)

Draws an image to the screen.

Optional d_width and d_height resize the image on screen. If omitted, the image's original dimensions are used.

Optional sx, sy, s_width, and s_height define a sub-region of the source image to draw, specified in pixels.

Affected by image_mode(), tint(), and the current transform.

image_mode(mode)

Changes how image position arguments are interpreted.

  • CORNER (default) — dx, dy is the top-left corner.
  • CORNERSdx, dy and d_width, d_height are opposite corners.
  • CENTERdx, dy is the center of the image.

light_directional(color, illuminance)

light_point(color, intensity, range, radius)

light_spot(color, intensity, range, radius, inner_angle, outer_angle)

line(x1, y1, x2, y2)

list_fonts()

load_font(path)

load_image(file)

Loads an image from a file and returns an Image object.

The path is relative to the sketch's assets directory.

metallic(value)

mode_2d()

mode_3d()

new_offscreen(width, height, asset_path, log_level) staticmethod

no_fill()

no_stroke()

no_text_feature(tag)

no_tint()

Removes the current tint color so images draw without color modification.

orbit_camera()

ortho(left, right, bottom, top, near, far)

pan_camera()

particles(particles, geometry)

perspective(fov, aspect, near, far)

point(x, y)

poll_for_sketch_update()

pop_matrix()

present()

push_matrix()

quad(x1, y1, x2, y2, x3, y3, x4, y4)

quadratic_vertex(cx, cy, x, y)

readback_png()

rect(x, y, w, h, tl, tr, br, bl)

rect_mode(mode)

reset_matrix()

rotate(angle)

rotate_x(angle)

rotate_y(angle)

rotate_z(angle)

roughness(value)

scale(*args)

set_material(material)

shear_x(angle)

shear_y(angle)

square(x, y, s)

stroke(*args)

stroke_cap(cap)

stroke_join(join)

stroke_weight(weight)

text(content, x, y, *args, max_w=None, max_h=None)

text_align(h, v=None)

text_ascent()

text_bounds(content, x, y, max_w=None, max_h=None)

text_descent()

text_feature(tag, value=None)

Enable/configure an OpenType font feature. text_feature("smcp") -> enable (value=1) text_feature("smcp", True) -> enable (value=1) text_feature("smcp", False) -> disable (value=0) text_feature("salt", 3) -> select alternate 3

text_font(font=None)

text_glyph_colors(colors)

Set per-glyph colors for the next text() call.

colors is a list of color objects (as built by color(...)); they are cycled across the glyphs of the next text() call.

text_glyph_rects(content, x, y, max_w=None, max_h=None)

Per-glyph bounding rects as a list of (x, y, w, h) tuples.

text_leading(leading)

text_line_count(content)

Number of lines content wraps to.

text_lines(content, x, y, max_w=None, max_h=None)

Per-line info as a list of (text, (x, y, w, h)) tuples.

text_size(size)

text_style(style)

text_to_contours(content, x, y)

Extract glyph outlines as per-contour path commands. Each contour (MoveTo...Close sequence) is a separate list. Commands use the same tuple shapes as text_to_paths.

text_to_model(content, x, y, depth)

Generate a 3D extruded mesh from text outlines.

text_to_paths(content, x, y)

Extract glyph outlines as path commands (one list per glyph). Each command is a tuple: ("M", x, y), ("L", x, y), ("Q", cx, cy, x, y), ("C", cx1, cy1, cx2, cy2, x, y), or ("Z",).

text_to_points(content, x, y, sample_factor=None)

Sample points along text outlines. Returns list of [x, y] points.

text_variation(tag, value)

text_weight(weight)

text_width(content)

text_wrap(mode)

tint(*args)

Sets a tint color applied when drawing images.

Accepts the same color arguments as fill(). The tint is multiplied with the image's pixel colors. Use no_tint() to remove.

translate(*args)

triangle(x1, y1, x2, y2, x3, y3)

unlit()

use_material(material)

vertex(x, y)

Image

sampler(sampler)

Applies a Sampler to this image, controlling filtering and wrapping.

s = Sampler(filter=Sampler.NEAREST, wrap=Sampler.REPEAT)
img.sampler(s)

Light

look_at(*args)

position(*args)

Material

pbr(**kwargs) staticmethod

set(**kwargs)

unlit(**kwargs) staticmethod

Monitor

height property

name property

position property

refresh_rate_millihertz property

scale_factor property

width property

workarea property

Particles

capacity property

apply(compute, **kwargs)

dispatch a compute kernel against these particles' buffers. buffers are auto-bound by attribute name; kwargs are forwarded to compute.set(...).

buffer(attribute)

backing Buffer for a registered attribute, or None if not registered.

emit(n, **kwargs)

emit n particles into the next ring-buffer slots. per-attribute data is a kwarg keyed by attribute name; each value is a flat list of n * format.float_count() floats.

emit_gpu(n, compute)

emit n particles via a GPU kernel. auto-binds buffers and an emit_range: vec4<f32> = (base_slot, n, capacity, 0) uniform.

Quat

w property writable

x property writable

y property writable

z property writable

dot(other)

from_axis_angle(axis, angle) staticmethod

from_euler(x, y, z) staticmethod

from_rotation_x(angle) staticmethod

from_rotation_y(angle) staticmethod

from_rotation_z(angle) staticmethod

identity() staticmethod

inverse()

length()

mul_vec3(v)

normalize()

slerp(other, t)

to_euler()

Sampler

Configures how an image is sampled when drawn.

Controls texture filtering and edge wrapping behavior.

  • filterSampler.LINEAR (smooth) or Sampler.NEAREST (pixelated).
  • wrapSampler.CLAMP (default), Sampler.REPEAT, or Sampler.MIRROR. Use wrap_x/wrap_y to set each axis independently.

CLAMP = 0 class-attribute instance-attribute

LINEAR = 0 class-attribute instance-attribute

MIRROR = 2 class-attribute instance-attribute

NEAREST = 1 class-attribute instance-attribute

REPEAT = 1 class-attribute instance-attribute

Shader

load(path) staticmethod

Surface

display_density property

focused property

pixel_density property

pixel_height property

pixel_width property

position property

center_on(monitor)

focus()

hide()

iconify()

maximize()

poll_events()

position_on(monitor, x, y)

restore()

set_always_on_top(on_top)

set_decorated(decorated)

set_fullscreen(monitor=None)

set_opacity(opacity)

set_pixel_density(density)

set_position(x, y)

set_resizable(resizable)

set_title(title)

set_visible(visible)

show()

Topology

LineList instance-attribute

LineStrip instance-attribute

PointList instance-attribute

TriangleList instance-attribute

TriangleStrip instance-attribute

Vec2

ONE instance-attribute

X instance-attribute

Y instance-attribute

ZERO instance-attribute

x property writable

xx property

xxx property

xxxx property

xxxy property

xxy property

xxyx property

xxyy property

xy property

xyx property

xyxx property

xyxy property

xyy property

xyyx property

xyyy property

y property writable

yx property

yxx property

yxxx property

yxxy property

yxy property

yxyx property

yxyy property

yy property

yyx property

yyxx property

yyxy property

yyy property

yyyx property

yyyy property

abs()

add(*args)

angle()

angle_between(v1, v2) staticmethod

clamp(min, max)

copy()

dist(other)

distance(other)

div(n)

dot(other)

equals(other)

extend(z)

from_angle(angle) staticmethod

hash_code()

heading()

length()

length_squared()

lerp(other, t)

limit(max)

mag()

mag_sq()

max(other)

min(other)

mult(n)

normalize()

perpendicular()

random() staticmethod

rotate(angle)

set(*args)

set_heading(angle)

set_mag(len)

sub(*args)

to_list()

to_tuple()

Vec3

ONE instance-attribute

X instance-attribute

Y instance-attribute

Z instance-attribute

ZERO instance-attribute

x property writable

xx property

xxx property

xxxx property

xxxy property

xxxz property

xxy property

xxyx property

xxyy property

xxyz property

xxz property

xxzx property

xxzy property

xxzz property

xy property

xyx property

xyxx property

xyxy property

xyxz property

xyy property

xyyx property

xyyy property

xyyz property

xyz property

xyzx property

xyzy property

xyzz property

xz property

xzx property

xzxx property

xzxy property

xzxz property

xzy property

xzyx property

xzyy property

xzyz property

xzz property

xzzx property

xzzy property

xzzz property

y property writable

yx property

yxx property

yxxx property

yxxy property

yxxz property

yxy property

yxyx property

yxyy property

yxyz property

yxz property

yxzx property

yxzy property

yxzz property

yy property

yyx property

yyxx property

yyxy property

yyxz property

yyy property

yyyx property

yyyy property

yyyz property

yyz property

yyzx property

yyzy property

yyzz property

yz property

yzx property

yzxx property

yzxy property

yzxz property

yzy property

yzyx property

yzyy property

yzyz property

yzz property

yzzx property

yzzy property

yzzz property

z property writable

zx property

zxx property

zxxx property

zxxy property

zxxz property

zxy property

zxyx property

zxyy property

zxyz property

zxz property

zxzx property

zxzy property

zxzz property

zy property

zyx property

zyxx property

zyxy property

zyxz property

zyy property

zyyx property

zyyy property

zyyz property

zyz property

zyzx property

zyzy property

zyzz property

zz property

zzx property

zzxx property

zzxy property

zzxz property

zzy property

zzyx property

zzyy property

zzyz property

zzz property

zzzx property

zzzy property

zzzz property

abs()

add(*args)

angle_between(v1, v2) staticmethod

clamp(min, max)

copy()

cross(other)

dist(other)

distance(other)

div(n)

dot(other)

equals(other)

extend(w)

hash_code()

length()

length_squared()

lerp(other, t)

limit(max)

mag()

mag_sq()

max(other)

min(other)

mult(n)

normalize()

random() staticmethod

set(*args)

set_mag(len)

sub(*args)

to_list()

to_tuple()

truncate()

Vec4

ONE instance-attribute

W instance-attribute

X instance-attribute

Y instance-attribute

Z instance-attribute

ZERO instance-attribute

w property writable

ww property

www property

wwww property

wwwx property

wwwy property

wwwz property

wwx property

wwxw property

wwxx property

wwxy property

wwxz property

wwy property

wwyw property

wwyx property

wwyy property

wwyz property

wwz property

wwzw property

wwzx property

wwzy property

wwzz property

wx property

wxw property

wxww property

wxwx property

wxwy property

wxwz property

wxx property

wxxw property

wxxx property

wxxy property

wxxz property

wxy property

wxyw property

wxyx property

wxyy property

wxyz property

wxz property

wxzw property

wxzx property

wxzy property

wxzz property

wy property

wyw property

wyww property

wywx property

wywy property

wywz property

wyx property

wyxw property

wyxx property

wyxy property

wyxz property

wyy property

wyyw property

wyyx property

wyyy property

wyyz property

wyz property

wyzw property

wyzx property

wyzy property

wyzz property

wz property

wzw property

wzww property

wzwx property

wzwy property

wzwz property

wzx property

wzxw property

wzxx property

wzxy property

wzxz property

wzy property

wzyw property

wzyx property

wzyy property

wzyz property

wzz property

wzzw property

wzzx property

wzzy property

wzzz property

x property writable

xw property

xww property

xwww property

xwwx property

xwwy property

xwwz property

xwx property

xwxw property

xwxx property

xwxy property

xwxz property

xwy property

xwyw property

xwyx property

xwyy property

xwyz property

xwz property

xwzw property

xwzx property

xwzy property

xwzz property

xx property

xxw property

xxww property

xxwx property

xxwy property

xxwz property

xxx property

xxxw property

xxxx property

xxxy property

xxxz property

xxy property

xxyw property

xxyx property

xxyy property

xxyz property

xxz property

xxzw property

xxzx property

xxzy property

xxzz property

xy property

xyw property

xyww property

xywx property

xywy property

xywz property

xyx property

xyxw property

xyxx property

xyxy property

xyxz property

xyy property

xyyw property

xyyx property

xyyy property

xyyz property

xyz property

xyzw property

xyzx property

xyzy property

xyzz property

xz property

xzw property

xzww property

xzwx property

xzwy property

xzwz property

xzx property

xzxw property

xzxx property

xzxy property

xzxz property

xzy property

xzyw property

xzyx property

xzyy property

xzyz property

xzz property

xzzw property

xzzx property

xzzy property

xzzz property

y property writable

yw property

yww property

ywww property

ywwx property

ywwy property

ywwz property

ywx property

ywxw property

ywxx property

ywxy property

ywxz property

ywy property

ywyw property

ywyx property

ywyy property

ywyz property

ywz property

ywzw property

ywzx property

ywzy property

ywzz property

yx property

yxw property

yxww property

yxwx property

yxwy property

yxwz property

yxx property

yxxw property

yxxx property

yxxy property

yxxz property

yxy property

yxyw property

yxyx property

yxyy property

yxyz property

yxz property

yxzw property

yxzx property

yxzy property

yxzz property

yy property

yyw property

yyww property

yywx property

yywy property

yywz property

yyx property

yyxw property

yyxx property

yyxy property

yyxz property

yyy property

yyyw property

yyyx property

yyyy property

yyyz property

yyz property

yyzw property

yyzx property

yyzy property

yyzz property

yz property

yzw property

yzww property

yzwx property

yzwy property

yzwz property

yzx property

yzxw property

yzxx property

yzxy property

yzxz property

yzy property

yzyw property

yzyx property

yzyy property

yzyz property

yzz property

yzzw property

yzzx property

yzzy property

yzzz property

z property writable

zw property

zww property

zwww property

zwwx property

zwwy property

zwwz property

zwx property

zwxw property

zwxx property

zwxy property

zwxz property

zwy property

zwyw property

zwyx property

zwyy property

zwyz property

zwz property

zwzw property

zwzx property

zwzy property

zwzz property

zx property

zxw property

zxww property

zxwx property

zxwy property

zxwz property

zxx property

zxxw property

zxxx property

zxxy property

zxxz property

zxy property

zxyw property

zxyx property

zxyy property

zxyz property

zxz property

zxzw property

zxzx property

zxzy property

zxzz property

zy property

zyw property

zyww property

zywx property

zywy property

zywz property

zyx property

zyxw property

zyxx property

zyxy property

zyxz property

zyy property

zyyw property

zyyx property

zyyy property

zyyz property

zyz property

zyzw property

zyzx property

zyzy property

zyzz property

zz property

zzw property

zzww property

zzwx property

zzwy property

zzwz property

zzx property

zzxw property

zzxx property

zzxy property

zzxz property

zzy property

zzyw property

zzyx property

zzyy property

zzyz property

zzz property

zzzw property

zzzx property

zzzy property

zzzz property

abs()

add(*args)

angle_between(v1, v2) staticmethod

clamp(min, max)

copy()

dist(other)

distance(other)

div(n)

dot(other)

equals(other)

hash_code()

length()

length_squared()

lerp(other, t)

limit(max)

mag()

mag_sq()

max(other)

min(other)

mult(n)

normalize()

set(*args)

set_mag(len)

sub(*args)

to_list()

to_tuple()

truncate()

acos(x)

arc(cx, cy, w, h, start, stop, mode=0)

asin(x)

background(*args)

begin_contour()

begin_shape(kind=0)

bezier(x1, y1, x2, y2, x3, y3, x4, y4)

bezier_vertex(cx1, cy1, cx2, cy2, x, y)

blend_mode(mode)

camera_center(*args)

camera_distance(distance)

camera_look_at(*args)

camera_max_distance(max)

camera_min_distance(min)

camera_position(*args)

camera_reset()

camera_speed(speed)

circle(cx, cy, d)

color_hex(s)

color_mode(mode, max1=None, max2=None, max3=None, max_alpha=None)

constrain(value, low, high)

create_color(*args)

create_image(width, height)

curve(x1, y1, x2, y2, x3, y3, x4, y4)

curve_vertex(x, y)

directional_light(color, illuminance, *, position=None, look_at=None)

disable_camera()

display_density()

dist(*args)

draw_box(*args)

draw_capsule(radius, length, detail=24)

draw_cone(radius, height, detail=24)

draw_conical_frustum(radius_top, radius_bottom, height, detail=24)

draw_cylinder(radius, height, detail=24)

draw_geometry(geometry)

draw_plane(width, height)

draw_sphere(radius, sectors=32, stacks=18)

draw_tetrahedron(radius)

draw_torus(radius, tube_radius, major_segments=24, minor_segments=16)

ellipse(cx, cy, w, h)

ellipse_mode(mode)

emissive(*args)

end_contour()

end_shape(close=False)

exp(x)

fill(*args)

flush()

free_camera()

full_screen(monitor=None)

hsla(h, s, l, a=1.0)

hsva(h, s, v, a=1.0)

hwba(h, w, b, a=1.0)

image(source, dx, dy, d_width=None, d_height=None, sx=None, sy=None, s_width=None, s_height=None)

Draws an image to the screen.

Optional d_width/d_height resize on screen; defaults to the image's original dimensions. Optional sx/sy/s_width/s_height select a sub-region of the source image in pixels.

image_mode(mode)

Changes how image position arguments are interpreted.

  • CORNER (default) — dx, dy is the top-left corner.
  • CENTERdx, dy is the center.
  • CORNERSdx, dy and d_width, d_height are opposite corners.

kernel_noise()

kernel_transform()

key_is_down(key_code)

key_just_pressed(key_code)

lab(l, a_axis, b_axis, alpha=1.0)

lch(l, c, h, a=1.0)

lerp(start, stop, amt)

line(x1, y1, x2, y2)

linear_rgb(r, g, b, a=1.0)

load_gltf(path)

load_image(image_file)

Loads an image from a file and returns an Image object.

log(x)

loop_()

mag(*args)

metallic(value)

midi_connect(port)

midi_disconnect()

midi_list_ports()

midi_note_off(note)

midi_note_on(note, velocity)

midi_play_notes(note, duration)

midi_refresh_ports()

mode_2d()

mode_3d()

monitors()

no_fill()

no_loop()

no_stroke()

no_tint()

Removes the current tint so images draw without color modification.

norm(value, start, stop)

oklab(l, a_axis, b_axis, alpha=1.0)

oklch(l, c, h, a=1.0)

orbit_camera()

pan_camera()

particles(particles, geometry)

pixel_density(density=None)

point(x, y)

point_light(color, intensity, range, radius, *, position=None, look_at=None)

pop_matrix()

pow(base, exponent)

primary_monitor()

push_matrix()

quad(x1, y1, x2, y2, x3, y3, x4, y4)

quadratic_vertex(cx, cy, x, y)

quat(*args)

rect(*args)

rect_mode(mode)

redraw()

remap(value, start1, stop1, start2, stop2, within_bounds=False)

reset_matrix()

rotate(angle)

rotate_x(angle)

rotate_y(angle)

rotate_z(angle)

roughness(value)

round(x)

run()

scale(*args)

shear_x(angle)

shear_y(angle)

size(width, height)

spot_light(color, intensity, range, radius, inner_angle, outer_angle, *, position=None, look_at=None)

sq(x)

sqrt(x)

square(x, y, s)

srgb(r, g, b, a=1.0)

stroke(*args)

stroke_cap(cap)

stroke_join(join)

stroke_weight(weight)

tint(*args)

Sets a tint color applied when drawing images.

translate(*args)

triangle(x1, y1, x2, y2, x3, y3)

unlit()

use_material(material)

vec2(*args)

vec3(*args)

vec4(*args)

vertex(x, y)

window_always_on_top(on_top)

window_center_on(monitor)

window_decorated(decorated)

window_iconify()

window_maximize()

window_move(x, y)

window_opacity(opacity)

window_position_on(monitor, x, y)

window_resizable(resizable)

window_resize(w, h)

window_restore()

window_title(title)

window_visible(visible)

xyz(x, y, z, a=1.0)