[]为什么调用封装的原生画线api不显示?
js封装
laya调用
function drawLine(layaCvs,startX,startY,toX,toY,lineWidth,strokeStyle,lineCap)
{
var layaCanvas = layaCvs;
var oContext = layaCanvas.getContext("2d");
oContext.beginPath();
oContext.moveTo(startX, startY);
oContext.lineTo(toX, toY);
oContext.lineWidth = lineWidth;
oContext.strokeStyle = strokeStyle;
oContext.lineCap = lineCap; //自定义线帽
oContext.stroke();
}
laya调用
var canvas:* = Browser.canvas;
__JS__("drawLine(canvas, 0, 0, 300, 300, 15, '#ff0000','round')");
没有找到相关结果
已邀请:
2 个回复
Aar0n
赞同来自:
Charles
赞同来自: