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

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

171. 播放视频只有声音没有图像 [ 67%]

...nager; export default class LoginGame extends Laya.Scene { constructor() { super(); LoginGame.instance = this; Laya.MouseManager.multiTouchEnabled = false; this.loadScene("LoginGame.scene"); } onEnable() { SoundManager.playMusic("audio/梅林茂 - 静かな古都.mp3", 0); this.login_game_button.on(...

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

172. 封装类的时候 怎么在类中表示自身? [ 67%]

...类中表示自身? class BackGround extends Laya.Sprite{ constructor() { super(); new init(); function init() { var bg1 = new Laya.Sprite(); var bg2 = new Laya.Sprite(); //背景图 // box.loadImage("../bin/background.png"); // Laya.stage.addChild(box); bg1.loadImage("../bin/background.png"); this....

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

173. tiledMap问题,getTileProperties获取地图属性不能获取到 [ 67%]

... = 'res/tiled/map.json';  /**地图 */ map: Laya.TiledMap; constructor(){ super(); Laya.loader.create(this.MAP_URL, new Laya.Handler(this, this.onComplete)) }  private onComplete(){ this.map = new Laya.TiledMap(); this.map.createMap(this.MAP_URL, new Laya.Rectangle(0,0,Laya.stage.width, Laya.stage...

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

174. [LayaAir 2.0] 如何用代码为Spirte添加2d物理特性 [ 67%]

...sionBoll extends Laya.Sprite { private _boll1:Laya.Sprite; constructor() { super(); //物理模块 this._boll1 = new Laya.Sprite(); this.addChild(this._boll1); this._boll1.x = 20; this._boll1.loadImage('comp/btn_close.png'); let box:laya.physics.BoxCollider = this._boll1.addComponent(laya.physics.Bo...

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

175. 输入设备-贪吃蛇(重力感应) [ 67%]

...Handler; var WebGL = Laya.WebGL; function Segment(width, height) { Segment.super(this); Segment.prototype.init = function() { this.graphics.drawRect(-height / 2, -height / 2, width + height, height, "#FF7F50"); } // 获取关节另一头位置 Segment.prototype.getPinPosition = function() { var radi...

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

176. 如何给Tab里的button设置点击事件? [ 67%]

...: 2328 关注: 2 人 Y_Yao • 2017-05-16 10:26 function daoju() { daoju.super(this); this.Tab_ZM.selectHandler = new Laya.Handler(this, onSelect); } function onSelect(index) { console.log("当前选择的标签页索引为:" + index);); this.Tab_ZM.on(Event.CLICK,this,onDaoju(index)); }...

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

177. 版本管理swf找同名的Json文件发现找不到 [ 67%]

...nds Laya.MovieClip{         constructor(){             super();         }         //初始化预加载数据         public m_initData(url:string,atlas:boolean,atlasPath?:string){             (atlas===void 0)&& (atlas=false);      ...

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

178. 输入设备-贪吃蛇(重力感应) [ 67%]

...ight; } } class Segment extends Laya.Sprite { constructor(width, height) { super(); this.size(width, height); this.init(); } init() { this.graphics.drawRect(-this.height / 2, -this.height / 2, this.width + this.height, this.height, "#FF7F50"); } // 获取关节另一头位置 getPinPosition() { cons...

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

179. Image.loadImage 方法加载问题 [ 67%]

...aya.Image;   private btnEnter:Laya.Button;   constructor()   {    super();    this.initUI();   }   private initUI () : void   {    this.bg = new Laya.Image();    this.btnEnter = new Laya.Button();    this.btnEnter.skin = "gamebutton/button_window_public_space_enter.png"; ...

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

180. Laya.timer.loop() 报错 Cannot read property 'loop' of null [ 67%]

... n:number = 0; private x0:number = 0; private y0:number = 0; constructor(){super();} onEnable():void{ this.x = this.x0; this.y = this.y0; Laya.timer.loop(20, this, this.frameWork); // 每 20 ms 执行一次 } private frameWork():void{ this.y = this.y0 + 10 * (this.n % 3); alert("move "); } }代码...

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