大约有 185 项符合查询结果, 库内数据总量为 30,778 项。 (搜索耗时: 0.0037 秒)
...h(food); const foodSize = 40; food.size(foodSize, foodSize); food.graphics.drawRect(0, 0, foodSize, foodSize, "#00BFFF"); food.x = Math.random() * Laya.stage.width; food.y = Math.random() * Laya.stage.height; } } class Segment extends Laya.Sprite { constructor(width, height) { super(); this.size(wid...
来源: Laya2.0_示例 发布时间: 20241118
...对象呀? 请问LayaAir如何绘制一个渐变矩形? this.graphics.drawRect(0, 0, 500, 350, "#ffffff") drawRect(x:Number, y:Number, width:Number, height:Number, fillColor:*, lineColor:* = null, lineWidth:Number = 1):void 参数fillColor:* — 填充颜色,或者填充绘图的渐变对象 ...
来源: Laya_社区 发布时间: 20180904
# 绘制矩形与圆角矩形 ### 一、用drawRect方法绘制矩形 在API中搜索`laya.display.Graphics`类可以查看到该API的各种矢量绘图方法。其中"drawRect();"方法用于绘制矢量矩形。该方法的详细说明如下图所示: ![blob.png](img/1.png) (图1) ...
来源: Laya2.0_文档 发布时间: 20210715
...angeSize(); if(_tip) _tip.destroy(); _tip = new Sprite(); _tip.graphics.drawRect(0,0,100,100,"#FFFFFF"); _tip.size(100,100); Laya.stage.addChild(_tip); Tween.to(_tip,{y:Browser.height - _tip.height,x:Browser.width-_tip.width},2000,null); } } } 附件 : --> 2019-05-20 添加评论 免费...
来源: Laya_社区 发布时间: 20190520
... Laya.stage.addChild(sp[j + i * 10]); sp[j + i * 10].graphics.drawRect(0, 0, 50, 50, "black"); sp[j + i * 10].size(50, 50); sp[j + i * 10].pos(i * 60, j * 60); sp[j + i * 10].on(Laya.Event.MOUSE_OVER, this, over); sp[j + i * 10].on(Laya.Eve...
来源: Laya_社区 发布时间: 20160715
...vate var testPan:Sprite; public function MainUi() { super(); this.graphics.drawRect(0,0,500,500,"#fff0cc"); testPan = new Sprite(); testPan.name = "testPan"; this.addChild( testPan ); testPan.pos( 300,300); testPan.graphics.drawRect(0,0,90,100,"#faaff0"); testPan.on(Event.CLICK,this,onMouseClick); t...
来源: Laya_社区 发布时间: 20161124
...btn = new Sprite(); Laya.stage.addChild(btn); btn.size(w, h); btn.graphics.drawRect(0, 0, w, h, "#FF7F50"); btn.graphics.fillText(labelText, w / 2, 8, "24px SimHei", "#FFFFFF", "center"); return btn; } // 播放音效 onPlaySound() { console.log("播放音效"); Laya.SoundManager.playSound("res/soun...
来源: Laya2.0_示例 发布时间: 20241118
... Laya.Sprite, Event = Laya.Event; this.sp = new Sprite(); this.sp.graphics.drawRect(0, 0, 200, 200, "#D2691E"); this.sp.pivot(100, 100); this.sp.x = Laya.stage.width / 2; this.sp.y = Laya.stage.height / 2; this.sp.size(200, 200); Laya.stage.addChild(this.sp); this.sp.on(ROTATE, this, this.onRotate);...
来源: Laya2.0_示例 发布时间: 20241118
...teSprite(); })(); function createSprite() { sp = new Sprite(); sp.graphics.drawRect(0, 0, 200, 200, "#D2691E"); sp.pivot(100, 100); sp.x = Laya.stage.width / 2; sp.y = Laya.stage.height / 2; sp.size(200, 200); Laya.stage.addChild(sp); sp.on(ROTATE, this, onRotate); // 侦听自定义的事件 sp.on(...
来源: Laya_示例 发布时间: 20241118
... var h = 40; var button = new Sprite(); button.size(w, h); button.graphics.drawRect(0, 0, w, h, "#FF7F50"); button.graphics.fillText(label, w / 2, 8, "25px SimHei", "#FFFFFF", "center"); Laya.stage.addChild(button); return button; } function onPlayMusic(e) { console.log("播放音乐"); SoundManager...
来源: Laya_示例 发布时间: 20241118