cocos2d-cli 1.6.1 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cocos2d-cli.js +11 -31
- package/package.json +3 -3
- package/src/commands/screenshot.js +11 -6
- package/src/lib/cc/CCLabel.js +27 -2
- package/src/lib/cc/CCRichText.js +44 -0
- package/src/lib/cc/CCSprite.js +2 -2
- package/src/lib/cc/index.js +3 -1
- package/src/lib/json-parser.js +27 -8
- package/src/lib/screenshot/index.html +1 -1
- package/src/lib/screenshot-core.js +6 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Screenshot Core Module
|
|
2
|
+
* Screenshot Core Module
|
|
3
3
|
* 渲染 JSON 数据并使用 Playwright 截图
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -16,6 +16,7 @@ const DEFAULT_CONFIG = {
|
|
|
16
16
|
outputDir: process.cwd(),
|
|
17
17
|
viewport: { width: 750, height: 1334 },
|
|
18
18
|
fullPage: true,
|
|
19
|
+
debugBounds: false,
|
|
19
20
|
timeout: 30000,
|
|
20
21
|
waitTime: 1000
|
|
21
22
|
};
|
|
@@ -224,7 +225,10 @@ async function takeScreenshot(userConfig = {}) {
|
|
|
224
225
|
|
|
225
226
|
// 加载页面
|
|
226
227
|
console.log('\n=== Loading Page ===');
|
|
227
|
-
|
|
228
|
+
const pageUrl = config.debugBounds
|
|
229
|
+
? `${serverUrl}/index.html?debugBounds=true`
|
|
230
|
+
: `${serverUrl}/index.html`;
|
|
231
|
+
await page.goto(pageUrl, {
|
|
228
232
|
waitUntil: 'networkidle',
|
|
229
233
|
timeout: config.timeout
|
|
230
234
|
});
|