大约有 185 项符合查询结果, 库内数据总量为 30,778 项。 (搜索耗时: 0.0039 秒)
...00; this.sp = new Sprite(); Laya.stage.addChild(this.sp); this.sp.graphics.drawRect(0, 0, w, h, "#FF7F50"); this.sp.size(w, h); this.sp.pivot(w / 2, h / 2); this.sp.pos(Laya.stage.width / 2, Laya.stage.height / 2); this.sp.on(Event.MOUSE_DOWN, this, this.onMouseDown); } onMouseDown(e) { const Event ...
来源: Laya2.0_示例 发布时间: 20241118
...ce); reference.pos(100, 100); reference.size(600, 400); reference.graphics.drawRect(0, 0, reference.width, reference.height, "#CCCCCC"); // 每次舞台尺寸变更时,都会调用Utils.fitDOMElementInArea设置Video的位置,对齐的位置和refence重合 Laya.stage.on(Laya.Event.RESIZE, this,...
来源: Laya2.0_示例 发布时间: 20241118
...r hitArea = new Laya.HitArea(); var graphic = new Laya.Graphics(); graphic.drawRect(-rectangle.x, -rectangle.y, rectangle.width, rectangle.height); hitArea.hit = graphic; skeleton.hitArea = hitArea; Laya.stage.graphics.drawRect(-rectangle.x, -rectangle.y, rectangle.width, rectangle.height, "#FFFFFF"...
来源: Laya_社区 发布时间: 20171114
...uideContainer.cacheAs = "bitmap"; var hitArea = new HitArea(); hitArea.hit.drawRect(0, 0, width, height, "#000000"); guideContainer.hitArea = hitArea; var maskArea = new Sprite(); guideContainer.addChild(maskArea); maskArea.graphics.drawRect(0, 0, width, height, "#000000"); maskArea.alpha = 0.5; var...
来源: Laya_社区 发布时间: 20171031
...例子我们看下 测试代码: var sp:Sprite=new Sprite(); sp.graphics.drawRect(0,0,100,100,"#FF0000"); Laya.stage.addChild(sp); Tween.to(sp,{x:300,y:300,alpha:0.5},1000,null,Handler.create(this,function():void { sp.destroy(); })); Complete事件你没写错,就是那么写的 2017-06-08...
来源: Laya_社区 发布时间: 20170608
...发不了 var btn:Sprite = new Sprite(); login.addChild(btn); btn.graphics.drawRect(100, 200, 50, 50, "#000"); btn.pos(100, 200); btn.size(50,50); btn.on(Event.MOUSE_DOWN, this, function():void {console.log(1);}); btn.on换成Laya.stage.on是可以触发的,但是btn却触发不了。 麻烦解答...
来源: Laya_社区 发布时间: 20170525
...tion createSprite() { sp = new Sprite(); var w = 300, h = 300; sp.graphics.drawRect(0, 0, w, h, "#FF7F50"); sp.size(w, h); sp.pivot(w / 2, h / 2); sp.pos(Laya.stage.width / 2, Laya.stage.height / 2); Laya.stage.addChild(sp); sp.on(Event.MOUSE_DOWN, this, onMouseDown); } function onMouseDown(e) { var...
来源: Laya_示例 发布时间: 20241118
...00; this.sp = new Sprite(); Laya.stage.addChild(this.sp); this.sp.graphics.drawRect(0, 0, w, h, "#FF7F50"); this.sp.size(w, h); this.sp.pivot(w / 2, h / 2); this.sp.pos(Laya.stage.width / 2, Laya.stage.height / 2); this.sp.on(Event.MOUSE_DOWN, this, this.onMouseDown); } onMouseDown(e) { const Event ...
来源: Laya2.0_示例 发布时间: 20241118
...; // 创建按钮 this.btn = new Sprite().size(205, 55); this.btn.graphics.drawRect(0, 0, this.btn.width, this.btn.height, "#057AFB"); this.txt = new Text(); this.txt.text = "销毁"; this.txt.pos(75, 15); this.txt.fontSize = 25; this.txt.color = "#FF0000"; this.btn.addChild(this.txt); this.btn.pos(...
来源: Laya2.0_示例 发布时间: 20241118
...aphicBounds。 ```javascript var sp:Sprite = new Sprite(); sp.graphics.drawRect(0, 0, 100, 100, "#FF0000"); var bounds:Rectangle = sp.getGraphicBounds(); Laya.stage.addChild(sp); ``` getBounds可以满足多数多数需求,但由于其需要计算边界,不适合频繁调用。 2...
来源: Laya2.0_文档 发布时间: 20210715