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

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

121. 其他引擎的Demo-Example_21 [ 97%]

... Laya.stage.bgColor = "#3da8bb"; createCanvases(); Laya.timer.frameLoop(1, this, animate); Laya.stage.on('mousedown', this, onMouseDown); Laya.stage.on('mousemove', this, onMouseMove); Laya.stage.on('mouseup', this, onMouseUp); })(); function createCanvases() { var graphicsCanvas = new Sprite(); Lay...

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

122. 屏幕适配-屏幕适配 [ 97%]

...e(); bg.skin = "res/bg.jpg"; Laya.stage.addChild(bg); //实例一个文本 this.txt = new Text(); this.txt.text = "点击我切换适配模式(noscale)"; this.txt.bold = true; this.txt.pos(0, 200); this.txt.fontSize = 30; this.txt.on("click", this, this.onTxtClick); Laya.stage.addChild(this.txt); //...

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

123. 鼠标交互-拖动 [ 97%]

...bgColor = "#232628"; Stat.show(); Laya.loader.load(ApePath, Handler.create(this, this.setup)); } setup() { this.createApe(); this.showDragRegion(); } createApe() { const Sprite = Laya.Sprite, Event = Laya.Event; this.ape = new Sprite(); this.ape.loadImage(ApePath); Laya.stage.addChild(this.ape); let...

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

124. Laya.loader.load(xx) 当地址""的时候,会报错。 [ 97%]

... laya 引擎是2.5的      Laya.loader.load(cg_url,Laya.Handler.create(this,()=>{             let tur:Laya.Texture = Laya.loader.getRes(cg_url);             if(tur)img_cg.graphics.drawImage(tur)         }),null,Laya.Loader.IMAGE);    这段代码, 当 cg_...

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

125. 鼠标交互-键盘交互 [ 97%]

...leMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { this.listenKeyboard(); this.createLogger(); Laya.timer.frameLoop(1, this, this.keyboardInspector); } listenKeyboard() { const Event = Laya.Event; // 用Set实现更好一些 keyDownList = []; // 添...

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

126. 使用百度地图显示当前位置(TypeScript-LayaAir基础篇(TS)-硬件设备相关) [ 97%]

...Map;       // 百度地图命名空间 private convertor = new this.BMap.Convertor(); // 坐标转换接口   private mapDiv; // 包含百度地图的div容器 ``` ### 二、接着是构造函数: ```typescript class WatchPosition { constructor() { Laya.init(1, 1); this.init(); /...

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

127. 全局动画不能加载 [ 97%]

...id 0)&& (loop=true); (name===void 0)&& (name=""); if (name)this._setFramesFromCache(this._url+"#"+name); this._isPlaying=true; this.index=((typeof start=='string'))? this._getFrameByLabel(start):start; this.loop=loop; if (this._frames && this._frames.length > 1 && ...

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

128. Sprite-节点控制 [ 97%]

...aya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.createApes(); } createApes() { const Sprite = Laya.Sprite; let monkey2Path = "res/apes/monkey2.png"; this.ape1 = new Sprite(); this.ape2 = new Sprite(); this.ape1.loadImage(monkey2Path); this.ape2.loadImage(monkey2Path);...

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

129. 性能测试-骨骼 [ 97%]

...e: Loader.IMAGE }, { url: mAniPath, type: Loader.BUFFER }], Handler.create(this, onAssetsLoaded)); } init(); function onAssetsLoaded() { var tTexture = Loader.getRes(mTexturePath); var arraybuffer = Loader.getRes(mAniPath); mFactory = new Templet(); mFactory.on(Event.COMPLETE, this, parseComplete); ...

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

130. Layabox web 复制一段文字到剪贴板 [ 97%]

...ction copyText(str) { new ShowDiv(str); }  function ShowDiv(str) {  var _this = thisthis.AppConfirm = document.getElementById("AppConfirm"); if (this.AppConfirm == null) { this.AppConfirm = document.createElement("div"); document.body.appendChild(this.AppConfirm); this.AppConfirm.id = "AppConf...

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