Add API Reference

2025-12-25 20:32:05 +00:00
parent 1c4b548510
commit 6df95c3122

30
API-Reference.md Normal file

@@ -0,0 +1,30 @@
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.line(x1, y1, x2, y2, color=0)|Line segment|
|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.rand(min=0, max=1)|Random float|
|s.randi(min=0, max=1)|Random integer|