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

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

51. 资源加载 · LayaAir3.0文档 · LAYABOX [ 74%]

...amp;& (i = 0); //清除sp节点的所有绘图(不含子节点) sp.graphics.clear(); //在sp节点上重绘纹理 sp.graphics.drawTexture(res[i]); i++; }); }); } } 2.2 可带类型的多资源加载方式 假如,多数资源不需要带类型,有的资源又需要用类型区别,该如...

来源: Laya3.0_文档 发布时间: 20230728

52. 想用camera做一个类似照相机的功能 [ 74%]

...     this.imgSp = new Sprite();             this.imgSp.graphics.clear();             this.imgSp.cacheAs = "bitmap";             Laya.stage.addChild(this.imgSp);             this.imgSp.graphics.drawTexture(rtex); 2020-06-02 0 0 分享 微博 Q...

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

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

...游戏开发基础,本篇从API到示例分别介绍Sprite.loadImage与Graphics.drawTexture两种显示图片的方法。 ## 1、用loadImage方法显示与切换图片 ### 1.1 loadImage API概述 在API文档中搜索laya.display.Sprite,可以找到loadImage()方法,如图1所示,我们先...

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

54. 显示与切换图片(ActionScript-LayaAir基础篇(AS3)-位图) [ 74%]

...游戏开发基础,本篇从API到示例分别介绍Sprite.loadImage与Graphics.drawTexture两种显示图片的方法。 ## 1、用loadImage方法显示与切换图片 ### 1.1 loadImage API概述 在API文档中搜索laya.display.Sprite,可以找到loadImage()方法,如图1所示,我们先...

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

55. 分享:改变图片皮肤,保持图片原样宽高显示 [ 74%]

...rivate function onClick():void { image.skin="bg.jpg"; } } }方法2:使用graphics.drawTexture的方式】 package { import laya.display.Sprite; import laya.events.Event; import laya.net.Loader; import laya.resource.Texture; import laya.utils.Handler; public class LayaAirDemo { private var sp:Sprit...

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

56. 【简单跑酷--JS版】---Lv.6 终篇 [ 73%]

...prite(); this.bar = new Sprite(); this.bar.x = 15; this.bar.y = 2; this.bg.graphics.drawTexture(texture1, 0, 0, 180, 21); this.bar.graphics.drawTexture(texture2, 0, 0, 155, 12); this.addChild(this.bg); this.addChild(this.bar); } /** * 修改当前状态 */ _proto.changeValue = function(value){ this....

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

57. 小游戏安卓不支持filters [ 73%]

...通过手指的移动去绘制线条 下面是部分代码 this.cutLayer.graphics.clear(); for(i = this.lines.length - 1; i >= 0; i--){ var line = this.lines[i]; line.state++; if(line.state > 7){ this.lines.splice(i, 1); } this.cutLayer.graphics.drawLine(line.x1, line.y1, line.x2, line.y2, "#f...

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

58. layaAir真的没办法做涂鸦板? [ 73%]

layaAir真的没办法做涂鸦板? 我用sp.graphics.drawLines方法做了个鼠标画线,确实是连续画的时间长了,就会很卡,在平板上尤其明显,画两三条线之后就不行了,没办法解决吗?用JS原生的画线方法怎么能加载我的内容上呢,我是...

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

59. 显示对象的mask缩放为0时遮罩效果不生效 [ 72%]

...testSp = new Laya.Sprite(); testSp.width = 200; testSp.height = 50; testSp.graphics.clear(); testSp.graphics.drawRect(0, 0, testSp.width, testSp.height,'#FF0000'); let tmpMask = new Laya.Sprite(); tmpMask.width = testSp.width; tmpMask.height = testSp.height; tmpMask.graphics.clear(); tmpMask.graphic...

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

60. 关于fillText问题 [ 72%]

...问题 private label_image:Laya.Sprite=new Laya.Sprite(); this.label_image.graphics.fillText(xxx, xxx,"15px Arial","#000000","center"); this.label_image.pos(0,0) Laya.stage.addChild(this.label_image); 这样写为什么CurMem会增加接近16M,这不就是在精灵上绘制嘛,简单来说就...

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