melonjs-camera-and-drawing SKILL.md skillA
melonjs-camera-and-drawing from melonjs/melonjs is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add melonjs/melonjs/melonjs-camera-and-drawing@git:20261105.7570a25Pins git:20261105.7570a25 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- melonjs/melonjs
- Path
packages/melonjs/skills/melonjs-camera-and-drawing/SKILL.md- Versions recorded
- 8
- Latest version
- git:20261105.7570a25, committed Nov 5, 2026
- First version recorded
- Oct 11, 2026
- Size
- 22,597 bytes
- Repository stars
- 6,441
- License
- MIT
Use this skill for camera control and immediate-mode drawing in melonJS — following a target, viewport bounds, shake and fade, secondary cameras and what each one draws, and drawing shapes, lines and gradients inside a custom draw(). Covers world versus screen coordinate conversion, clipping and masking, baking with CanvasRenderTarget, and reading pixels back. Triggers on: Camera2d, viewport, follow, offset, look ahead, setBounds, minimap, second camera, split screen, cullMask…
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# Camera and immediate-mode drawing ## Following a target ```js app.viewport.follow(player, app.viewport.AXIS.BOTH, 0.1); ``` **Pass the renderable, not `renderable.pos`.** `follow()` accepts a `Renderable`, a `Vector2d` or a `Vector3d` and **throws** `invalid target for me.Camera2d.follow` for anything else. A renderable's `pos` is an `ObservableVector3d`, which is not a `Vector3d` subclass, so `follow(player.pos, …)` throws. The third argument is a damping factor in `[0 .. 1]` — lower is smoother and laggier, `1` snaps. Omit it for a hard lock (it defaults to `1`). It is frame-rate independent since 19.7. `AXIS.HORIZONTAL` / `AXIS.VERTICAL` / `AXIS.BOTH` / `AXIS.NONE`. Call it from the followed entity's `onActivateEvent`, using `this.parentApp`. **To frame the target off centre, set `offset`; do not follow a helper object.** It shifts the view without moving the camera, in world units, and is applied after following and the bounds, so the view can show past them: ```js app.viewport.follow(player, app.viewport.AXIS.BOTH, 0.1); app.viewport.offset.set(0, -70); // look a little above the feet // or ahead of where the player faces, eased (see math.damp below) …
Read the whole file at its exact version.
How to install
mdr add melonjs/melonjs/melonjs-camera-and-drawing@sha256:db82cb6fc41ab2cdThe line at the top of this page pins the label git:20261105.7570a25, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_rcbh5cllmnji6g2z)
1 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 8 versions of this file, between Oct 11, 2026 and Nov 5, 2026, about one every 4 days.
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20261105.7570a25 latest | 2026-11-05 | 7570a25 | 22,597 B | A | view · diff |
| git:20261102.a41d6a3 | 2026-11-02 | a41d6a3 | 20,373 B | A | view · diff |
| git:20261102.e99059c | 2026-11-02 | e99059c | 19,660 B | A | view · diff |
| git:20261026.a1e952f | 2026-10-26 | a1e952f | 19,482 B | A | view · diff |
| git:20261025.d9abca5 | 2026-10-25 | d9abca5 | 18,661 B | A | view · diff |
| git:20261023.988ab1f | 2026-10-23 | 988ab1f | 16,509 B | A | view · diff |
| git:20261011.806ee0a | 2026-10-11 | 806ee0a | 15,799 B | A | view · diff |
| git:20261011.ea10090 | 2026-10-11 | ea10090 | 14,935 B | A | view |
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (22597 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
melonjs/melonjs · 6,441 stars · license MIT · pushed 2026-11-06 · branch master
API
GET https://markdownregistry.com/api/v1/artifacts/art_rcbh5cllmnji6g2z GET https://markdownregistry.com/api/v1/resolve?ref=melonjs/melonjs/melonjs-camera-and-drawing GET https://markdownregistry.com/api/v1/blob/db82cb6fc41ab2cdef369a67332ae613db11d1f6e55d62c5aa2ce8847a232435
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.