你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
cuixueying
赞同来自:
devilsome
a1284964657
该问题目前已经被锁定, 无法添加新回复
6 个回复
cuixueying
赞同来自:
cuixueying
赞同来自:
devilsome
赞同来自:
每帧移动都需要clear,draw
a1284964657
赞同来自:
a1284964657
赞同来自:
{
var Sprite = Laya.Sprite;
var Stage = Laya.Stage;
var WebGL = Laya.WebGL;
var sp;
(function()
{
// 不支持WebGL时自动切换至Canvas
Laya.init(740, 400, WebGL);
Laya.stage.alignV = Stage.ALIGN_MIDDLE;
Laya.stage.alignH = Stage.ALIGN_CENTER;
Laya.stage.scaleMode = "showall";
Laya.stage.bgColor = "#232628";
drawSomething();
})();
function drawSomething()
{
sp = new Sprite();
Laya.stage.addChild(sp);
//绘制圆角矩形,自定义路径
sp.graphics.drawPath(0, 0, [
["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"
});
sp.x = 800;
sp.scale(0.5,0.5);
}
})();
cuixueying
赞同来自: