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

大约有 1,490 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0058 秒)

111. 鼠标交互-滑动 [ 91%]

...age.height / 2; button.on(Event.MOUSE_DOWN, this, onMouseDown); Laya.stage.addChild(button); //左侧临界点设为圆形初始位置 beginPosition = button.x; //右侧临界点设置 endPosition = beginPosition + TrackLength; } function drawTrack() { var graph = new Sprite(); Laya.stage.graphics.d...

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

112. Cannot read property 'rayCast' of undefined [ 91%]

...new Laya.Scene3D(); this.camera = new Laya.Camera(0, 0.1, 100); Laya.stage.addChild(this.scene); this.scene.addChild(this.camera); this.camera.transform.translate(new Laya.Vector3(0, 3.5, 1)); this.camera.transform.rotate(new Laya.Vector3(-15, 0, 0), true, false); //3.清除照相机颜色 this.came...

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

113. 分享:DrawToCanvas内存释放问题! [ 91%]

...加被截屏对象 sp= new Sprite(); sp.loadImage("bg2.png"); Laya.stage.addChild(sp); //创建DrawToCanvas命令按钮 var btnDraw:Sprite=CreateBtn(100,400); btnDraw.on(Event.CLICK,this,onClickBtnDraw); } //创建按钮 private function CreateBtn(xx:int,yy:int):Sprite { var btn:Sprite=new Sprite();...

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

114. 文本-HTML文本 [ 91%]

...DivElement = Laya.HTMLDivElement; let p = new HTMLDivElement(); Laya.stage.addChild(p); p.style.font = "Impact"; p.style.fontSize = 30; let html = "使用"; html += "HTMLDivElement"; html += "创建的"; html += "HTML文本"; p.innerHTML = html; } showExternalHTML() { const HTMLIframeElement = Laya....

来源: Laya2.0_示例 发布时间: 20251130

115. 关于缓动函数from的一些问题记录 [ 91%]

...true); function onEaseComplete(){ console.log("ease complete"); Laya.stage.addChild(letterText); } ``` 以上的代码主要存在三个问题: 1. from()中的duration和delay都是以毫秒为单位,所以3,1想表示3秒,1秒需要使用3000,1000作为参数 2. Laya.Handler 的创建需要使用La...

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

116. 三个图好像无法绑定不同的事件? [ 91%]

...r.ldc.layabox.com/demo/h5/res/apes/monkey2.png',100,100,90,90); Laya.stage.addChild(img1); img1.on(Laya.Event.CLICK,this, function(name){ console.log(name);},['图1']); var img2 = new Laya.Sprite(); img2.loadImage('https://layaair.ldc.layabox.com/demo/h5/res/apes/monkey2.png',200,300,90,90); Laya.st...

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

117. iphoneX环境下新手引导的抠图透明区域为黑色,其它机型都是正常的。 [ 91%]

...r = new Sprite(); this.guideContainer.cacheAs = "bitmap"; Utils.GuideLayer.addChild(this.guideContainer); this.guideContainer.on(Laya.Event.CLICK, this, this.nextStep); this.mouseEnabled = false; var maskArea: Laya.Sprite = new Laya.Sprite(); maskArea.alpha = 0.5; maskArea.graphics.drawRect(0, 0, La...

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

118. rigidBody.applyForce 对刚体应用力,物体没有移动 [ 90%]

...tmpVector = new Laya.Vector3(0, 0, 0);         this.scene = Laya.stage.addChild(new Laya.Scene3D());         //初始化照相机         let camera = this.scene.addChild(new Laya.Camera(0, 0.1, 100));         camera.transform.translate(new Laya.Vector3(0, 6, 9.5));         camer...

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

119. 获取sprite对象的 width和height为0 [ 90%]

...super() this.bt = new Laya.Sprite() this.bt.loadImage("res/boat.png") this.addChild(this.bt) } } /** * 游戏背景 */ class BackGround extends Laya.Sprite { //背景图 private bg:Laya.Sprite; constructor(){ super(); this.init(); } init():void{ this.bg = new Laya.Sprite() this.bg.loadImage("res/bac...

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

120. Sprite optimizeScrollRect = true 似乎有问题 [ 90%]

...(0, 0, this.width, this.height); this.mask.optimizeScrollRect = true; this.addChild(this.mask); } this.initContent = function () { this.content = new Box(); this.content.width = this.width; this.content.autoSize = true; this.content.y = this.scrollMode == DOWN_TO_TOP ? this.height : 1; this.mask.add...

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