construct3-resize-project
Resize and scale Construct 3 project source folders, especially converting layouts and viewport from one 16:9 resolution to another such as 1920x1080 to 1280x720. Use when Codex needs to migrate .c3pr
SKILL.mdconstruct3-resize-project/SKILL.md
GitHubConstruct 3 Resize Project
Workflow
Use this skill for Construct 3 source-folder projects, not exported web builds. Prefer the bundled script for the mechanical migration, then inspect suspicious leftovers manually.
- Confirm the source and target resolutions. For a proportional 16:9 resize, use one scale factor:
1280 / 1920 = 720 / 1080 = 2/3
- Create a backup before editing:
Compress-Archive -Path project.c3proj,layouts,eventSheets,scripts -DestinationPath construct3-resize-backup.zip -Force
- Run
scripts/resize_construct3_project.jsfrom the project root. - Validate all JSON files parse.
- Search for old hardcoded values and inspect every remaining hit.
- Tell the user to reload/reopen Construct before saving, because the editor can overwrite external JSON edits from memory.
Script
Run:
node C:\Users\Abhinav\.codex\skills\construct3-resize-project\scripts\resize_construct3_project.js --from 1920x1080 --to 1280x720 --cwd .
Useful flags:
node ...\resize_construct3_project.js --from 1920x1080 --to 1280x720 --cwd . --dry-run
node ...\resize_construct3_project.js --from 1920x1080 --to 1280x720 --cwd . --script-speed scripts\guideHand.js:HAND_SPEED
The script scales:
project.c3projviewportWidthandviewportHeight- every runtime
layouts/*.jsonlayoutwidthandheight - instance
world.x,world.y,world.width,world.height - text size and text margins
- particle size/speed/randomiser pixel values
- Sine behavior
magnitudeandmagnitude-random - event-sheet spatial constants for
create-object,set-position,pick-overlapping-point,pick-nearestfurthest,set-size,set-width,set-height,set-scale,set-magnitude, Tweenposition, Tweensize, Tweenscale, TweenoffsetX/offsetY - simple JavaScript constants named through
--script-speed, e.g.const HAND_SPEED = 400;
The script intentionally does not scale:
- UID/SID values
- pair IDs, indexes, state numbers, counters
- times, wait durations, playback rates
- opacity, volume, stereo pan
- sprite animation frame asset dimensions in
objectTypes - layout editor
.uistate.jsonview positions, unless the user specifically asks for editor-state cleanup
Manual Checks
After running the script, search for old resolution anchors:
rg -n -g "!*.uistate.json" "\b1920\b|\b1080\b|\b960\b|\b540\b" project.c3proj layouts eventSheets scripts
Remaining hits can be valid, but inspect each one:
- A remaining
960,540in runtime logic may need to become640,360. - A remaining
1024inobjectTypes/*.jsonusually is an image asset frame size and should stay unchanged. - Expressions like
LayoutWidth/2andLayoutHeight/2are already relative and should stay unchanged. - Expressions like
ImageCard.X + 20should scale only the pixel offset, becomingImageCard.X + 13.333333.
Safety Rules
- Keep a backup zip before any migration.
- Do not scale project IDs, object SIDs, instance UIDs, function parameters used as IDs, or event state values.
- Do not delete assets or object types as part of resizing.
- If the project is open in Construct, warn the user to reload before saving.
- For non-proportional changes, stop and ask whether to use independent X/Y scaling or preserve aspect ratio with letterboxing.