Clone
7
API Reference
Hugo H edited this page 2025-12-26 10:17:07 +00:00

The following functions are provided by the library:

Drawing Functions

Function Description
s.cls(color=0) Clear screen
s.rectfill(x, y, w, h, color=0) Filled rectangle
s.circfill(x, y, r, color=0) Filled circle
s.ovalfill(x, y, rx, ry, color = 0) Filled oval
s.rect(x, y, w, h, color=0) Rectangle
s.circ(x, y, r, color=0) Circle
s.oval(x, y, rx, ry, color = 0) Oval
s.line(x1, y1, x2, y2, color=0) Line segment
s.linewidth(thickness) Change line thickness
s.text(x, y, message, color=3, size="normal") Text rendering

Transformations and styles

Function Description
s.push() / s.pop() State stack
s.translate(x, y) Move origin
s.rotate(radians) Rotate origin
s.alpha(value) Change global transparency (0.0-1.0)

Input and utilities

Function Description
s.iskeydown(key) Keyboard state
s.iskeypressed(key) Is key newly pressed
s.rand(min=0, max=1) Random float
s.randi(min=0, max=1) Random integer
s.rseed(seed) Set RNG seed

Sounds and music

Function Description
s.sfx(ZzFXParams, pitchSlide, volume) Play a ZzFX sound effect
s.volume(volume) Change the volume