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

大约有 6,598 项符合查询结果, 库内数据总量为 31,722 项。 (搜索耗时: 0.0142 秒)

1571. Laya的UI对象为何没有 userData属性 [ 70%]

...可以绑定任意的自定义数据。 目前我已经用 let view:View = new View(); view["userData"] = myObject; 实现了 2018-06-14 0 0 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 要回复问题请先登录 发起人 bearocean 相关问题 看了其他引擎才发现 LA...

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

1572. img点击事件。点击图片外,也触发了事件。请问怎么解决 [ 70%]

...res/img/m1.jpg",Laya.Handler.create(this,load)); function load(){ let ctn2=new Laya.Sprite(); Laya.stage.addChild(ctn2); var gq=new Laya.Sprite(); gq.loadImage("res/img/m1.jpg",100,100,100,100);   ctn2.addChild(gq); gq.on(Laya.Event.CLICK,this,Is);   }  function Is(){ console.log(1); } 2018-08-06...

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

1573. dialog第二次不弹出了 [ 70%]

...人 Coder张琦 • 2018-09-03 18:24 使用DialogManager打开 let store = new Store(); var dialogM = new Laya.DialogManager(); store.isModal = true; dialogM.open(store, true, true); store.onClosed = () => { dialogM.removeSelf(); } 不知道是不是最佳的,但是解决了 Coder张琦 • 201...

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

1574. HScrollBar属性详解(JavaScript-IDE篇(JS)-IDE组件属性详解) [ 70%]

... function createHScroller() { //实例化垂直滚动条 this.hScrollBar = new HScrollBar(); //加载皮肤资源(其他资源根据规范命名后,会自动加载) this.hScrollBar.skin = "res/ui/hscroll.png"; //设置宽度 this.hScrollBar.width = 400; //设置位置 this.hScrollBar.pos(150, ...

来源: Laya2.0_文档 发布时间: 20210714

1575. 多线程worker(JavaScript-2D进阶篇(JS)-游戏加载策略) [ 70%]

...件,放到index.html中。代码如下: ```typescript var myWorker = new Worker("my_task.js"); myWorker.onmessage = function (oEvent) { console.log("Called back by the worker!\n"); }; myWorker.postMessage("start"); // start the worker. ``` 新建一个my_task.js文件,代码如下: ```typesc...

来源: Laya2.0_文档 发布时间: 20210715

1576. event自定义事件的问题 [ 69%]

...ample() { super(); //初始化引擎 Laya.init(1136, 640); var re:Revent = new Revent(); var de:DisEvent = new DisEvent(); } } } Revent类: package { import laya.display.Sprite; public class Revent extends Sprite { public function Revent() { super(); on(LayaSample.event, this, onhandler); trace("...

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

1577. 关于HTMLCanvas 截图功能 [ 69%]

...横竖屏 Laya.stage.screenMode = "vertical"; Laya.Stat.show(); var icon = new Laya.Sprite(); icon.loadImage('img/test.png'); Laya.stage.addChild(icon); document.body.addEventListener("click",function(){ var kk = icon.drawToCanvas(431, 428).getContext('2d').canvas; var img = new Image(); img.src = k...

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

1578. Laya.SoundManager.playSound报错 [ 69%]

..._Aaron 赞同来自: SoundManager.playSound("../../res/sounds/btn.mp3", 1, new Handler(this, onComplete));  SoundManager.playMusic("../../res/sounds/bgm.mp3", 1, new Handler(this, onComplete));   https://layaair.ldc.layabox.co ... eDemo 2018-06-14 0 1 分享 微博 QZONE 微信 Laya_Aaron 赞同...

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

1579. 问个关于die的问题 [ 69%]

...回复 cuixueying 赞同来自: 用TimeLine的方式即可 var sp:Sprite=new Sprite(); sp.graphics.drawRect(0,0,100,100,"#FF0000"); Laya.stage.addChild(sp); var timeLine:TimeLine=new TimeLine(); timeLine.to(sp,{x:50,y:50},1000).to(sp,{x:30,y:30},1000); timeLine.play(); 2017-06-15 0 2 分享 微博 Q...

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

1580. TiledMap创建地图在LayaAir中显示不完全 [ 69%]

...LIGN_MIDDLE; Laya.stage.screenMode = Laya.stage.SCREEN_NODE;*/ this.tMap = new Laya.TiledMap(); var viewRect = new Laya.Rectangle(0,0,W,H); this.tMap.createMap("../bin/res/TileMap/orthogonal.json",viewRect);   } Start(); 附件 : --> 2018-09-15 添加评论 免费帖 --> 分享 微博 QZONE 微信 ...

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