基础工程骨架:game.js 入口、Canvas 渲染、DevTools 项目配置。 包含 CLAUDE.md / AGENTS.md 及 KB 知识库接入。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
13 lines
352 B
JavaScript
13 lines
352 B
JavaScript
const { windowWidth, windowHeight } = wx.getSystemInfoSync()
|
|
|
|
const canvas = wx.createCanvas()
|
|
const ctx = canvas.getContext('2d')
|
|
|
|
ctx.fillStyle = '#ffffff'
|
|
ctx.fillRect(0, 0, windowWidth, windowHeight)
|
|
|
|
ctx.fillStyle = '#333333'
|
|
ctx.font = '24px sans-serif'
|
|
ctx.textAlign = 'center'
|
|
ctx.fillText('微信小游戏', windowWidth / 2, windowHeight / 2)
|