[]laya微信打包问题很多呀,就是加了一些绘图api,就报错

空白项目在微信开发者工具端成功打开(没有压缩,压缩也会报错),后加了一些绘图api,报错如一楼图。添加绘图api代码如下
module laya {
import Sprite = Laya.Sprite;
import Stage = Laya.Stage;
import WebGL = Laya.WebGL;

export class Sprite_DrawShapes {
private sp: Sprite;

constructor()
{
// 不支持WebGL时自动切换至Canvas
Laya.MiniAdpter.init();
Laya.init(740, 400);

Laya.stage.alignV = Stage.ALIGN_MIDDLE;
Laya.stage.alignH = Stage.ALIGN_CENTER;

Laya.stage.scaleMode = "showall";
Laya.stage.bgColor = "#232628";

this.drawSomething();
}

private drawSomething(): void {
this.sp = new Sprite();
Laya.stage.addChild(this.sp);
//画线
this.sp.graphics.drawLine(10, 58, 146, 58, "#ff0000", 3);
//画连续直线
this.sp.graphics.drawLines(176, 58, [0, 0, 39, -50, 78, 0, 117, 50, 156, 0], "#ff0000", 5);
//画曲线
this.sp.graphics.drawCurves(352, 58, [0, 0, 19, -100, 39, 0, 58, 100, 78, 0, 97, -100, 117, 0, 136, 100, 156, 0], "#ff0000", 5);
//画矩形
this.sp.graphics.drawRect(10, 166, 166, 90, "#ffff00");
//画多边形
this.sp.graphics.drawPoly(264, 166, [0, 0, 60, 0, 78.48, 57, 30, 93.48, -18.48, 57], "#ffff00");
//画三角形
this.sp.graphics.drawPoly(400, 166, [0, 100, 50, 0, 100, 100], "#ffff00");
//画圆
this.sp.graphics.drawCircle(98, 332, 50, "#00ffff");
//画扇形
this.sp.graphics.drawPie(240, 290, 100, 10, 60, "#00ffff");
//绘制圆角矩形,自定义路径
this.sp.graphics.drawPath(400, 310, [["moveTo", 5, 0], ["lineTo", 105, 0], ["arcTo", 110, 0, 110, 5, 5], ["lineTo", 110, 55], ["arcTo", 110, 60, 105, 60, 5], ["lineTo", 5, 60], ["arcTo", 0, 60, 0, 55, 5], ["lineTo", 0, 5], ["arcTo", 0, 0, 5, 0, 5], ["closePath"]], {fillStyle: "#00ffff"});
}
}
}
new laya.Sprite_DrawShapes();
已邀请:

hill_0219

赞同来自:

发现问题了,不支持部分ts语法

hill_0219

赞同来自:

在core.js 
里面报错

qian

赞同来自:

用的是最新版本的引擎么~可以上传一下demo么

hill_0219

赞同来自:

嗯嗯,上传了,是最新的

该问题目前已经被锁定, 无法添加新回复

商务合作
商务合作