@honor-minigame/cli
Version:
honor minigame pack cli
22 lines (21 loc) • 643 B
Plain Text
##require
// 游戏相关配置
let element = document.createElement("div")
element.setAttribute("data-frame-rate", "60")
##content
document.body.appendChild(element)
egret.runEgret({
renderMode: "webgl",
audioType: 0,
calculateCanvasScaleFactor: function (context) {
let backingStore =
context.backingStorePixelRatio ||
context.webkitBackingStorePixelRatio ||
context.mozBackingStorePixelRatio ||
context.msBackingStorePixelRatio ||
context.oBackingStorePixelRatio ||
context.backingStorePixelRatio ||
1
return (window.devicePixelRatio || 1) / backingStore
},
})