Loading...
Loading...
Compare original and translation side by side
msw-searchmsw-search| Situation | Action |
|---|---|
| User wants a specific sprite | First use |
| Use that RUID directly. Do not invoke painter. |
| No search results, or all results are unsuitable | Invoke painter → create directly |
| User explicitly says "I need a hand-drawn looking character/icon" | Invoke painter directly |
| 场景 | 操作 |
|---|---|
| 用户需要特定精灵 | 先使用 |
| 直接使用该RUID。请勿调用绘图工具。 |
| 无搜索结果,或所有结果均不符合需求 | 调用绘图工具→直接创建 |
| 用户明确表示“我需要手绘风格的角色/图标” | 直接调用绘图工具 |
chunkymaplechunkymaplescripts/render.cjsmcp__msw-mcp__asset_create_resource_storage_itemchunkymaplechunkymaplescripts/render.cjsmcp__msw-mcp__asset_create_resource_storage_item| Medium | Recommended use | Strengths |
|---|---|---|
| SVG | Icons, logos, simple characters, shape-based pixel art | Intuitive code, easy to drop 1px |
| Canvas | Procedural patterns, iterative logic (loop-drawn textures / noise) | Generate complex patterns via JS programming logic |
| HTML | Composite layouts that can be styled quickly with CSS | Rarely used — SVG/Canvas is usually a better fit for pixel art |
| 媒介 | 推荐用途 | 优势 |
|---|---|---|
| SVG | 图标、logo、简单角色、基于形状的像素画 | 代码直观,可轻松添加1px的 |
| Canvas | 程序化图案、迭代逻辑(循环绘制纹理/噪点) | 通过JS编程逻辑生成复杂图案 |
| HTML | 可通过CSS快速样式化的复合布局 | 极少使用——SVG/Canvas通常更适合像素画 |
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"
width="100%" height="100%" preserveAspectRatio="xMidYMid meet"
style="image-rendering: pixelated;">
<rect x="6" y="2" width="1" height="1" fill="#4A90D9"/>
<!-- Place dots one by one with 1px rects -->
</svg>⚠️ Use(NOT a fixed pixel count). The SVG element draws at its own declared size inside the render.cjs viewport — if you hard-code 128 but render atwidth="100%" height="100%", the SVG fills only the top-left 128px and the rest of the PNG is transparent.--width 1024makes the SVG fill whatever canvas100%/--widthspecifies.--height
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"
width="100%" height="100%" preserveAspectRatio="xMidYMid meet"
style="image-rendering: pixelated;">
<rect x="6" y="2" width="1" height="1" fill="#4A90D9"/>
<!-- 逐个添加1px矩形像素点 -->
</svg>⚠️ 使用(不要固定像素值)。SVG元素会在render.cjs视口内按照自身声明的尺寸绘制——如果硬编码为128但以width="100%" height="100%"渲染,SVG只会填充左上角128px区域,PNG其余部分将为透明。--width 1024可让SVG填充100%/--width指定的任意画布尺寸。--height
// `c` (canvas element) and `ctx` (2D context) are auto-exposed by render.cjs.
// ctx.imageSmoothingEnabled = false is applied automatically as well.
// IMPORTANT: derive scale from c.width, not a hard-coded constant — otherwise
// a different --width leaves the bottom-right of the canvas blank.
const GRID = 16;
const scale = c.width / GRID; // 16×16 logical grid → canvas-sized output
ctx.fillStyle = '#4A90D9';
ctx.fillRect(6 * scale, 2 * scale, scale, scale);// `c`(画布元素)和`ctx`(2D上下文)由render.cjs自动暴露。
// ctx.imageSmoothingEnabled = false已自动设置。
// 重要:从c.width推导缩放比例,不要使用硬编码常量——否则
// 不同的--width会导致画布右下角留白。
const GRID = 16;
const scale = c.width / GRID; // 16×16逻辑网格→画布尺寸输出
ctx.fillStyle = '#4A90D9';
ctx.fillRect(6 * scale, 2 * scale, scale, scale);<!doctype html>
<html><body style="margin:0; image-rendering: pixelated;">
<!-- Anything you like -->
</body></html><!doctype html>
<html><body style="margin:0; image-rendering: pixelated;">
<!-- 自定义内容 -->
</body></html>| Style | Recommended use | Look & feel | Logical grid | Outline | Shading |
|---|---|---|---|---|---|
| Icons, buttons, tiles, blocks, simple props | Retro / 8-bit / NES-SNES | Small (16×16, 32×32) | Black or white, 1px | 2–4 stepped levels, NO AA |
| Characters, NPCs, monsters, cute mascots | MapleStory / storybook / cartoon | Larger (32×32 ~ 128×128) | Selout (darker version of fill color) | 4–6 stepped levels + selective AA on silhouette + optional 2×2 dithering |
| 风格 | 推荐用途 | 视觉感受 | 逻辑网格 | 轮廓 | 着色 |
|---|---|---|---|---|---|
| 图标、按钮、 tiles、方块、简单道具 | 复古/8位机/NES-SNES风格 | 小尺寸(16×16、32×32) | 黑色或白色,1px | 2-4阶分层,无抗锯齿 |
| 角色、NPC、怪物、可爱吉祥物 | MapleStory/故事书/卡通风格 | 大尺寸(32×32 ~ 128×128) | Selout(填充色的深色版本) | 4-6阶分层 + 轮廓处选择性抗锯齿 + 可选2×2抖动 |
chunkymaplechunkymaplefilter: blurdrop-shadowchunkymaplechunkymaplefilter: blurdrop-shadow| Use | Recommended size |
|---|---|
| Icon / button | 48×48 ~ 64×64 |
| Character / item / NPC / monster | 96×96 ~ 128×128 |
| Tile / floor / block | 64×64 ~ 128×128 |
| Background / large object | 256×256 or larger (only on explicit request) |
If the requested output is below 64×64, thestyle does not have enough pixels for selout + AA + facial features — either bump the output size to 64+ or fall back tomaple.chunky
| 用途 | 推荐尺寸 |
|---|---|
| 图标/按钮 | 48×48 ~ 64×64 |
| 角色/物品/NPC/怪物 | 96×96 ~ 128×128 |
| Tile/地板/方块 | 64×64 ~ 128×128 |
| 背景/大型物体 | 256×256或更大(仅在明确请求时使用) |
如果请求的输出尺寸小于64×64,风格没有足够像素来实现selout + 抗锯齿 + 面部特征——要么将输出尺寸提升至64+,要么切换为maple风格。chunky
render.cjsrender.cjscd scripts && npm cipuppeteerpackage-lock.json🔒 Use, notnpm ci.npm installinstalls exactly the versions pinned innpm ciand fails if the lockfile andpackage-lock.jsondisagree — this is the supply-chain integrity guarantee for W012. Never editpackage.jsonby hand; if you need to bump puppeteer, runpackage-lock.jsonlocally and commit the regenerated lockfile.npm install puppeteer@<version>
cd scripts && npm cipackage-lock.jsonpuppeteer🔒 使用,不要使用npm ci。npm install会安装npm ci中固定的精确版本,若lockfile与package-lock.json不一致则会失败——这是W012的供应链完整性保障。请勿手动编辑package.json;若需要升级puppeteer,请在本地运行package-lock.json并提交重新生成的lockfile。npm install puppeteer@<version>
render.cjsdata:Content-Security-Policydefault-src 'none'<script><foreignObject>on*data:PAINTER_DISABLE_SANDBOX=1render.cjsrender.cjsContent-Security-Policydefault-src 'none'data:<script><foreignObject>on*data:render.cjsPAINTER_DISABLE_SANDBOX=1node scripts/render.cjs --type <svg|canvas|html> --in <code-file> --out <out.png> --width <W> --height <H>echo "<svg ...>" | node scripts/render.cjs --type svg --out out.png --width 128 --height 128--typesvgcanvashtml--in---out--width--heightnode scripts/render.cjs --type <svg|canvas|html> --in <代码文件路径> --out <输出.png> --width <宽度> --height <高度>echo "<svg ...>" | node scripts/render.cjs --type svg --out out.png --width 128 --height 128--typesvgcanvashtml--in---out--width--heightmcp__msw-mcp__asset_create_resource_storage_item🔒 Security — handling the presigned URL (W007). Thereturned in step 1 is a short-lived signed credential (anyone holding it can PUT to that storage slot until it expires). Treat it as a secret:presignedUrl
- Never echo, quote, paraphrase, or include the URL or any of its query parameters (
,X-Amz-Signature, etc.) in the assistant's user-facing response, in commit messages, in logs, or in any subsequent prompt — including when reporting "what you did".X-Amz-Credential- When invoking the shell, pass the URL via the
environment variable as shown below, not as a command-line argument. Command-line arguments are visible to other processes viaPAINTER_PRESIGNED_URL(Linux/macOS) and/proc/*/cmdline(Windows), and they are recorded in shell history.Get-Process- When invoking step 3, pass the URL directly as the
tool argument — do not copy it into a code block or markdown for the user to see first.fileUrl- If the PUT step fails (typically
/401→ URL expired), discard the URL and restart from step 1. Do not reuse it elsewhere.403
mcp__msw-mcp__asset_create_resource_storage_item🔒 安全注意事项 —— 处理预签名URL(W007)。步骤1返回的是短期签名凭证(任何人持有该URL均可向对应存储槽PUT数据,直至过期)。请将其视为机密:presignedUrl
- 绝对不要在助手的用户响应、提交信息、日志或后续提示中回显、引用、改写或包含该URL及其任何查询参数(
、X-Amz-Signature等)——包括汇报“操作内容”时。X-Amz-Credential- 调用shell时,请通过
环境变量传递URL,如下所示,不要作为命令行参数。命令行参数可通过PAINTER_PRESIGNED_URL(Linux/macOS)和/proc/*/cmdline(Windows)被其他进程看到,且会被记录到shell历史中。Get-Process- 调用步骤3时,直接将URL作为
工具参数传递——不要将其复制到代码块或markdown中先展示给用户。fileUrl- 若PUT步骤失败(通常为
/401→ URL过期),请丢弃该URL并从步骤1重新开始。不要在其他地方复用。403
mcp__msw-mcp__asset_create_resource_storage_item({
category: "sprite",
subcategory: "<appropriate subcategory>", // e.g. "monster", "npc", "object", "icon"
name: "<resource name>",
description: "<1–2 sentence description>",
makerOwnerType: 0, // 0 = Account
makerOwnerId: "<account id>", // look up in advance with mcp__msw-mcp__account_get_my_user_id
// omit fileUrl in this step
})presignedUrlmcp__msw-mcp__asset_create_resource_storage_item({
category: "sprite",
subcategory: "<合适的子分类>", // 例如:"monster", "npc", "object", "icon"
name: "<资源名称>",
description: "<1-2句描述>",
makerOwnerType: 0, // 0 = 账户
makerOwnerId: "<账户ID>", // 提前通过mcp__msw-mcp__account_get_my_user_id查询
// 此步骤省略fileUrl
})presignedUrl$env:PAINTER_PRESIGNED_URL = "<presignedUrl from step 1>"
try {
Invoke-WebRequest -Method PUT -InFile out.png -Uri $env:PAINTER_PRESIGNED_URL -ContentType "image/png"
} finally {
Remove-Item Env:\PAINTER_PRESIGNED_URL -ErrorAction SilentlyContinue
}PAINTER_PRESIGNED_URL="<presignedUrl from step 1>" \
curl -X PUT -T out.png "$PAINTER_PRESIGNED_URL" && \
unset PAINTER_PRESIGNED_URLGet-Processps$env:PAINTER_PRESIGNED_URL = "<步骤1返回的presignedUrl>"
try {
Invoke-WebRequest -Method PUT -InFile out.png -Uri $env:PAINTER_PRESIGNED_URL -ContentType "image/png"
} finally {
Remove-Item Env:\PAINTER_PRESIGNED_URL -ErrorAction SilentlyContinue
}PAINTER_PRESIGNED_URL="<步骤1返回的presignedUrl>" \
curl -X PUT -T out.png "$PAINTER_PRESIGNED_URL" && \
unset PAINTER_PRESIGNED_URLGet-Processpsmcp__msw-mcp__asset_create_resource_storage_item({
...same arguments,
fileUrl: "<presignedUrl from step 1>" // pass directly as tool arg, do not echo
})mcp__msw-mcp__asset_create_resource_storage_item({
...相同参数,
fileUrl: "<步骤1返回的presignedUrl>" // 直接作为工具参数传递,不要回显
})asset_search_resourcesasset_list_account_resourcesobjectetcasset_search_resourcesasset_list_account_resourcesobjectetcRUID: <received RUID>
Style: <chunky | maple>
<1–2 sentence description: what you drew, at what size, and what sprite it was registered as>RUID: <获取到的RUID>
Style: <chunky | maple>
<1-2句描述:绘制的内容、尺寸、注册的精灵类型>npm cirender.cjsCannot find module 'puppeteer'npm cinpm install--width--heightwidth="128" height="128"scale = 8--width--heightwidth="100%" height="100%"c.widthReadchunkyarc()bezierCurveTo()maplestyle-maple-cartoon.mdmaplechunkycategorysubcategorynamedescriptionmakerOwnerTypemakerOwnerIdfileUrlrender.cjsnpm ciCannot find module 'puppeteer'npm cinpm install--width--heightwidth="128" height="128"scale = 8--width--heightwidth="100%" height="100%"c.widthchunkyarc()bezierCurveTo()maplestyle-maple-cartoon.mdmaplechunkycategorysubcategorynamedescriptionmakerOwnerTypemakerOwnerIdfileUrl