You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
### Unreleased
4
4
5
+
-**`SPRITEMODULATE` (basic-gfx + canvas WASM):** Per-slot draw tint and scale until **`LOADSPRITE`** / **`UNLOADSPRITE`**. Syntax: **`SPRITEMODULATE slot, alpha [, r, g, b [, scale_x [, scale_y]]]`** — **`alpha`** and **`r`/`g`/`b`** are **0–255** (**`alpha`** multiplies PNG alpha); **`scale_x`/`scale_y`** stretch the drawn quad (default **1**; one scale sets both). Implemented with Raylib **`Color`** + destination size; canvas uses bilinear-ish sampling + tint. **`gfx_sprite_set_modulate`** in **`basic_api.h`**.
6
+
5
7
-**Load normalization / identifiers containing `IF`:****`normalize_keywords_line`** treated **`IF`** inside identifiers as **`IF …`** (e.g. **`JIFFIES_PER_FRAME`** → **`J IF FIES_PER_FRAME`**, breaking assignments). The same **`prev_ident`** guard used for **`FOR`** (avoid splitting **`PLATFORM`**) now applies to the **`IF`** insertion rule. Regression: **`tests/if_inside_ident_normalize.bas`**.
6
8
7
9
-**`gfx_peek()` keyboard vs colour RAM**: With default bases, **`GFX_KEY_BASE` (0xDC00)** lies inside the colour RAM window **(0xD800 + 2000 bytes)**. **`gfx_peek()`** must resolve **keyboard before colour** or **`PEEK(56320+n)`** reads colour bytes (e.g. **14** for light blue). **`gfx_video.c`** documents the required order (**text → keyboard → colour → charset → bitmap**). **`gfx_video_test`** asserts key wins over colour at the aliased address.
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -390,6 +390,7 @@ Releases include **basic-gfx** — a full graphical version of the interpreter b
390
390
-**Tile sheet / tilemap:**`LOADSPRITE slot, "tiles.png", tw, th` treats the image as a grid of **tw×th** pixels per tile (row-major, left-to-right). Use **`DRAWSPRITETILE slot, x, y, tile_index [, z]`** with **1-based**`tile_index` (first tile = 1). **`SPRITETILES(slot)`** returns how many tiles are in the sheet. **`SPRITEW`/`SPRITEH`** return one tile’s size when a tilemap is loaded. **`DRAWSPRITE`** with **`sx, sy, sw, sh`** still works for arbitrary crops.
391
391
-**Gamepad (basic-gfx and canvas WASM):****`JOY(port, button)`** returns **1** if pressed, else **0**. **`JOYSTICK`** is an alias for **`JOY`**. **`JOYAXIS(port, axis)`** returns stick/trigger movement scaled to about **-1000..1000** (axes **0–5**: left X/Y, right X/Y, left trigger, right trigger). Port **0** is the first controller. **Native basic-gfx** uses Raylib button codes **1–15** (DPAD/face/triggers; **0** is unknown). **Canvas WASM** maps those codes to the browser **Standard Gamepad** layout via `navigator.getGamepads()` (polls each frame in `canvas.html`). **Terminal**`./basic` has no gamepad. Example: `./basic-gfx examples/gfx_joy_demo.bas`
392
392
-**Tile animation frame:** After **`LOADSPRITE slot, "sheet.png", tw, th`**, **`SPRITEFRAME slot, frame`** sets the **1-based** tile index used when **`DRAWSPRITE`** omits **`sx, sy, sw, sh`** (same as choosing that tile with **`DRAWSPRITETILE`**). **`SPRITEFRAME(slot)`** returns the current frame.
393
+
-**Tint / opacity / scale:****`SPRITEMODULATE slot, alpha [, r, g, b [, scale_x [, scale_y]]]`** — **`alpha`** and **`r`/`g`/`b`** are **0–255** (defaults **255**; **`alpha`** multiplies the PNG’s alpha). Optional **`scale_x`/`scale_y`** stretch the drawn sprite (default **1**; one number sets both). Resets to opaque white at **1×** on each **`LOADSPRITE`** / **`UNLOADSPRITE`**.
393
394
-`UNLOADSPRITE slot` frees that slot’s texture and clears its draw state so you can `LOADSPRITE` again (e.g. swap art or reclaim memory). No-op if the slot was empty.
394
395
-`DRAWSPRITE slot, x, y [, z [, sx, sy [, sw, sh ]]]` sets the **persistent** pose for that slot: the same image is drawn **every frame** until you call `DRAWSPRITE` again for that slot or the program exits (textures are freed when the window closes). **`x`, `y`** are **pixel** coordinates on the 320×200 framebuffer (not character rows): row *r* starts at **`y = r × 8`**. **`z`**: larger values paint **on top** (e.g. text/bitmap at 0, HUD at 200). Omit **`sx, sy`** to use the top-left of the image; omit **`sw, sh`** (or use ≤0) to use the rest of the texture from `(sx,sy)`. **Alpha** in the PNG is respected (transparency over text or bitmap).
395
396
-`SPRITEVISIBLE slot, 0|1` hides or shows a loaded sprite without unloading.
0 commit comments