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

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

711. 如何对3D精灵进行鼠标检测(JavaScript-3D基础(JS)-LayaAir3D之鼠标交互) [ 73%]

...g/1.png)(图1) ```typescript { //在舞台上添加鼠标事件监听 Laya.stage.on(Laya.Event.MOUSE_DOWN,this, this.onMouseDown); } //点击触发事件 onMouseDown() { //记录点击到舞台上的点 this.point.x = Laya.MouseManager.instance.mouseX; this.point.y = Laya.MouseManager.instance.mouse...

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

712. 如何对3D精灵进行鼠标检测(TypeScript-3D基础(TS)-LayaAir3D之鼠标交互) [ 73%]

...g/1.png)(图1) ```typescript { //在舞台上添加鼠标事件监听 Laya.stage.on(Laya.Event.MOUSE_DOWN,this, this.onMouseDown); } //点击触发事件 onMouseDown() { //记录点击到舞台上的点 this.point.x = Laya.MouseManager.instance.mouseX; this.point.y = Laya.MouseManager.instance.mouse...

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

713. 报错,这不是个构造函数 "StartPage is not a constructor" [ 73%]

...ple: var LayaSample = (function(){ (function(){ Laya.init(667,375); Laya.stage.bgColor = "#ffcccc"; Laya.loader.load("res/atlas/ui.atlas",Laya.Handler.create(this,onLoaded),null,Laya.Loader.ATLAS); })() function onLoaded(){ var StartPage = new StartPage(); Laya.stage.addChild(StartPage); var GameP...

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

714. 物理引擎-Slingshot [ 73%]

...rIDE让项目开发更高效。(function() { var Sprite = Laya.Sprite; var Stage = Laya.Stage; var Render = Laya.Render; var Browser = Laya.Browser; var WebGL = Laya.WebGL; var stageWidth = 800; var stageHeight = 600; var Matter = window.Matter; var LayaRender = window.LayaRender; var mouseConstrain...

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

715. 关于graphics镂空的问题https://ask.layabox.com/question/139 [ 73%]

...Box.autoSize = true; redBox.graphics.drawRect(0,0,100,100,'#ff0000'); Laya.stage.addChild(redBox); redBox.on("click",this,function(){ trace("click redbox"); }); redBox.on("mouseover",this,function(){ redBox.graphics.clear(); redBox.graphics.drawRect(0,0,100,100,'#00ff00'); }); redBox.on("mouseout",t...

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

716. 请问图片大小可以手动设置宽高吗?怎么设置,看到API里的Sprite的width和height无法设置,只用于碰撞检测 [ 73%]

...ian 赞同来自: this.bg_img.skin = "ui/bg.jpg"; this.bg_img.width = Laya.stage.width; this.bg_img.height = Laya.stage.height; Image使用skin修改显示,改变宽高时,会拉伸显示内容 2018-01-22 0 0 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 要回复问题请...

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

717. 音乐与音效的播放与控制(JavaScript-LayaAir基础篇(JS)-硬件设备相关) [ 73%]

...要开发者要自行在失去焦点和恢复的时候,通过侦听失去stage焦点和获得stage焦点进行控制,参考代码如下: ```typescript …… //循环播放_sound _sound.play(0); //失去舞台焦点(切出游戏)的处理 Laya.stage.on(Laya.Event.BLUR, this, () => { _sound...

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

718. 二进制图片(ActionScript-2D进阶篇(AS3)-游戏加载策略) [ 73%]

...图片到舞台; var sp:Sprite = new Sprite(); sp.loadImage(url); Laya.stage.addChild(sp);//添加到舞台 } private function errorHandler(e:Object):void { } } } ``` 第二种我们可以绘制一个纹理来显示: ```java private function completeHandler(data:Object):void { //加载完成返...

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

719. 无法清除指定定时器 [ 73%]

...            trace("______________________");         } this.stage.on(Event.MOUSE_UP, this, onB); private function onB():void          {             Laya.timer.clear(this, this.looppp);             SoundManager.playSound("res/sound/onClick.wav");         ...

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

720. 动画无法添加到舞台问题 [ 73%]

...dy.pos(-this.bound.width/2,-this.bound.height/2);//设置动画位置 Laya.stage.addChild(this.LeadBody);   上面是代码 2018-03-03 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提交 1 个回复 Laya_XS 赞同来自: 你的pl...

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