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

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

231. 加了两个遮罩后的动画,帧频只有10了,有demo,有项目,有源码 [ 66%]

...ation(); container.addChild(ani); ani.loadAtlas('1.json'); ani.play(); ani.pos(300,0); const d1 = 484; const d2 = 1438; const d3 = 950; const d4 = 1920; const container2 = new Laya.Sprite(); Laya.stage.addChild(container2); const mask2 = new Laya.Sprite(); mask2.graphics.drawPoly(d1, 0, [0, 0, d4 - ...

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

232. 显示与切换图片(JavaScript-LayaAir基础篇(JS)-位图) [ 66%]

...d() { ape = new Sprite(); Laya.stage.addChild(ape); ape.pivot(55, 72); ape.pos(200, 200); // 显示默认纹理 switchTexture(); ape.on("click", this, switchTexture); } function switchTexture() { var textureUrl = (flag = !flag) ? texture1 : texture2; // 更换纹理 ape.graphics.clear(); ape.loadIma...

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

233. 鼠标交互-双指旋转(多点触控) [ 65%]

...w, h, "#FF7F50"); this.sp.size(w, h); this.sp.pivot(w / 2, h / 2); this.sp.pos(Laya.stage.width / 2, Laya.stage.height / 2); this.sp.on(Event.MOUSE_DOWN, this, this.onMouseDown); } onMouseDown(e) { const Event = Laya.Event; // 手机上才有 touches 属性 let touches = e.touches; if (touches && to...

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

234. 3d场景下面有张2d的图片,当鼠标焦点不在该网页时,2d图片为啥会闪动 [ 65%]

...te0.loadImage("creatRoom/background_bk.png");             sprite0.pos(0,0 );             sprite0.cacheAsBitmap = true;             Laya.stage.addChildAt(sprite0,0);                          var sprite1:Sprite = new Sprite();             sprite1.l...

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

235. 1.0 骨骼drawcall优化猥琐方法 [ 65%]

... createSubmit(context:WebGLContext2D, ib:IndexBuffer2D, vb:VertexBuffer2D, pos:int, sv:Value2D):Submit {             var o:Submit = _cache._length ? _cache[--_cache._length] : new Submit();                          if (vb == null) {                ...

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

236. 鼠标交互-Hold [ 65%]

...der.getRes(apePath); ape.pivot(texture.width / 2, texture.height / 2); ape.pos(Laya.stage.width / 2, Laya.stage.height / 2); ape.scale(0.8, 0.8); Laya.stage.addChild(ape); // 鼠标交互 ape.on(Event.MOUSE_DOWN, this, onApePress); } function onApePress(e) { // 鼠标按下后,HOLD_TRIGGER_TIME毫...

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

237. 参照技术文档自定义Shader写的TypeScript版本,运行后 Sprite 显示尺寸不对,帮忙看下哪里要调整? [ 65%]

...9-04 1 2 分享 微博 QZONE 微信 devilsome 赞同来自: shader错了,pos处理没有加上世界坐标变换,要乘上mmat 如下 vec4 pos =mmat*vec4(position.x,position.y,0,1);   2017-09-04 0 1 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 要回复问题请先登录 ...

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

238. laya.ui.Box [ 65%]

...e(htmlCanvas);//使用htmlCanvas创建Texture var sp:Sprite = new Sprite().pos(0, 200);//创建精灵并把它放倒200位置 sp.graphics.drawTexture(texture);//把截图绘制到精灵上 Laya.stage.addChild(sp);//把精灵显示到舞台 也可以获取原始图片数据,分享到网上,从而...

来源: laya_api 发布时间: 20170929

239. 缓动-时间线 [ 65%]

...s/monkey2.png"); Laya.stage.addChild(target); target.pivot(55, 72); target.pos(100,100); } function createTimerLine() { timeLine.addLabel("turnRight",0).to(target,{x:450, y:100, scaleX:0.5, scaleY:0.5},2000,null,0) .addLabel("turnDown",0).to(target,{x:450, y:300, scaleX:0.2, scaleY:1, alpha:1},2000,...

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

240. 【LIST无法拖动】参照官方实例做的 [ 65%]

...}     find_StringAllIndex(str :String):String[]{         let pos_arr =[];         for(let i=0;i < str.length;i++){             let e = str.charAt(i);             if (e=="1"){                let  ii= i+1;           ...

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