• 首页
  • 动态
  • 案例
  • 引擎社区
  • API
  • 文档
  • 示例
  • 引擎下载

大约有 443 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 0.0040 秒)

311. 怎么像canvas那样做到每次循环去清空一次画布,我发现每次画的时候他会把上一次的坐标也画出来,导致变形了,该如何让他每次累加的同时清空上次的路径 [ 50%]

...同时清空上次的路径 var sp; var x = 0; export default class Scene extends Laya.Sprite{ constructor(){ super(); Laya.init(500, 300, Laya.WebGL); var bg = new Laya.Sprite(); bg.loadImage("comp/hunter.jpg"); this.addChild(bg); Laya.timer.frameLoop(1,this,this.move); // drawSomething(); } move()...

来源: Laya_社区 发布时间: 20190520

312. 2.x引擎项目升级指南 · LayaAir3.0文档 · LAYABOX [ 50%]

....on(Laya.Event.CLICK, ()=> { console.log("clicked"); }); class MyScript extends Laya.Script { //脚本事件 onMouseClick(e:Event) { console.log("clicked"); } } aNode.addComponent(MyScript); 以上两种方式是等价的,且在纯2D,或2D/3D混合这两种情况中均可正常使用。 3.2 2...

来源: Laya3.0_文档 发布时间: 20230406

313. list里面可以加入多个view吗? [ 50%]

...mport laya.ui.Image; import laya.ui.Label; import laya.ui.View; class Item extends View { public static var WID:int=150; public static var HEI:int=85; private var img:Image; private var label:Label; public function Item() { this.size(WID,HEI); img=new Image(); addChild(img); label=new Label(); label...

来源: Laya_社区 发布时间: 20170626

314. laya.sprite精灵无缝拼接地图,会出现黑线跟白线,使用laya的2.0.1beta版本 [ 50%]

...而且都是整数的移动地图的。   export default class MapSprite extends Laya.Image{ isShow:boolean = false; name:string = ""; constructor() { super(); }  loadImageAndPos(name:string,posX:number,posY:number):void { this.name = name; this.anchorX = 0; this.anchorY = 0; this.x = posX; //这...

来源: Laya_社区 发布时间: 20190315

315. List组件拖动浏览时item会出现重叠的现象 [ 50%]

... laya.ui.Image; import Label = Laya.Label; export class ListDataSourceItem extends Box { public static WID: number = 200; public static HEI: number = 20; // private _img: Image = null; private _lb:Label = null; constructor() { super(); this._lb = new Label(); this._lb.size(ListDataSourceItem.WID, Li...

来源: Laya_社区 发布时间: 20180410

316. UI弹窗 · LayaAir3.0文档 · LAYABOX [ 50%]

... const { regClass, property } = Laya; @regClass() export class UI_Dialog extends Laya.Script { private DIALOG_WIDTH: number = 220; private DIALOG_HEIGHT: number = 275; private CLOSE_BTN_WIDTH: number = 43; private CLOSE_BTN_PADDING: number = 5; private assets: any[]; private dialog: Laya.Dialog; con...

来源: Laya3.0_文档 发布时间: 20230303

317. 可以帮我测试一下吗? 使用mask的场景,放着就会出现记忆体用完的讯息? [ 50%]

...有将mask拿掉测试,发现就不会有类似问题。class GameLayer extends ui.GameLayerUI { private infos : any; constructor () { super (); this.infos = { rotation : 0 }; Laya.timer.frameLoop(1,this,()=> { this.infos.rotation += 1; if (this.infos.rotation >= 360) this.infos.rotation -= ...

来源: Laya_社区 发布时间: 20180720

318. webgl模式下对Panel组件旋转时Panel子对象显示错误的BUG! [ 50%]

...en.to(testSpriteRotation,{rotation:720},8000); } } class PanelRotationTest extends Laya.Sprite{ constructor(displayContainerClass:any){ super(); // var panel:Laya.Panel = new Laya.Panel(); //panel 有问题 // var panel:Laya.Sprite = new Laya.Sprite(); //sprite 无问题 var panel = new displayConta...

来源: Laya_社区 发布时间: 20170814

319. layaFlash 无法使用 Loader 加载外部SWF和图片 [ 50%]

...plicationDomain; import flash.system.LoaderContext; public class SwfBinary extends Sprite { public function SwfBinary() { super(); if(stage) { init(); } else { this.addEventListener(Event.ADDED_TO_STAGE,init); } } private function init(e:Event=null):void { var loader:Loader=new Loader(); var context...

来源: Laya_社区 发布时间: 20151224

320. 性能测试-虫子(慎入) [ 50%]

...t.pos(x, y); } tick += 0.1; } } } import laya.display.Sprite; class Maggot extends Sprite { public var direction:Number; public var turningSpeed:Number; public var speed:Number; public var offset:Number; }

来源: Laya_示例 发布时间: 20241002