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

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

581. CPU优化方式(TypeScript-2D进阶篇(TS)-性能优化) [ 81%]

...。 1. 使用getBounds/ getGraphicBounds。 ```typescript var sp=new Laya.Sprite(); sp.graphics.drawRect(0,0,100,100,"#FF0000"); var bounds:Laya.Rectangle=sp.getGraphicBounds(); Laya.stage.addChild(sp); ``` getBounds可以满足多数多数需求,但由于其需要计算边界,适合频繁调...

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

582. laya.display.css.TextStyle [ 81%]

...isplay.cssClasspublic class TextStyleInheritanceTextStyle laya.display.css.SpriteStyle 文本的样式类 Public Properties PropertyDefined By  align : String 表示使用此文本格式的文本段落的水平对齐方式。 TextStyle  asPassword : Boolean 指定文本字段是否是密码文...

来源: Laya2.0_api 发布时间: 20190513

583. HTMLCanvas Laya.stage.addChild(HTMLCanvas); 挂载到舞台报错 [ 81%]

...ron 赞同来自: /**          * <p>绘制 当前<code>Sprite</code> 到 <code>Canvas</code> 上,并返回一个HtmlCanvas。</p>          * <p>绘制的结果可以当作图片源,再次绘制到其他Sprite里面,示例:</p> ...

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

584. panle中 x或者y设置0 就显示[ 81%]

...的链接 提交 2 个回复 yplpf 赞同来自: cuixueying 已经解决,Sprite默认宽高为0,虽然 drawTexture画了一张图片出来, 但是由于宽高都是0, 当坐标X或者Y 为0以后, Laya就当它移到屏幕外面了,所以就显示了。   同时宽高为0,也能...

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

585. 关于HTMLCanvas 截图功能 [ 81%]

... Laya.stage.screenMode = "vertical"; Laya.Stat.show(); var icon = new Laya.Sprite(); icon.loadImage('img/test.png'); Laya.stage.addChild(icon); document.body.addEventListener("click",function(){ var kk = icon.drawToCanvas(431, 428).getContext('2d').canvas; var img = new Image(); img.src = kk.toDataU...

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

586. 遮罩在安卓显示正常,在ios下显示正常。 [ 81%]

...正常的 let tx:Laya.Texture = Laya.loader.getRes(url); let maskMc:Laya.Sprite = new Laya.Sprite(); maskMc.graphics.drawTexture(tx,0,0,tx.width,tx.height); this.bar.displayObject.mask = maskMc; this.bar.visible = true; maskMc 是外部加载的一个纹理,就算是一起放在fairygui里面的还...

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

587. 加载-销毁Texture使用的图片资源 [ 81%]

...Laya.stage.bgColor = "#232628"; Stat.show(); this.init(); } init() { const Sprite = Laya.Sprite, Animation = Laya.Animation, Text = Laya.Text, Event = Laya.Event; // 创建背景 this.spBg = Sprite.fromImage(PathBg); Laya.stage.addChild(this.spBg); // 创建动画 this.aniFly = new Animation(); this...

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

588. 请问object层中添加的sprite怎么添加点击事件 [ 81%]

请问object层中添加的sprite怎么添加点击事件 Object层是tiledmap最上面的一层,其中添加了一个sprite对象,但是给这个sprite添加鼠标点击事件起作用,请大神看看 mallLayer = tiledMap.getLayerByName("Object"); budai = tiledMap.getLayerObject("Object",...

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

589. 图片能按轴心旋转 [ 81%]

...aleMode = 'fixedauto' Laya.stage.screenMode = 'vertical' let bg = new Laya.Sprite(); bg.loadImage("../res/image/interface/intro_bg.png",375,667,1500,1500); bg.pivot(750,750) bg.alpha = 1 bg.rotation = 10图片是正方形的 如上设置过pivot之后 并没有按 正方形中心点旋转 2018-05-19...

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

590. 元素定义显示区域? [ 81%]

元素定义显示区域? 一个大的盒子(box或者sprite,在舞台中央,没有顶边),两边有两个元素要从左右两边缓动进入显示,但是开始的时候是看得到的。 要怎么做才能让这个超出这个盒子宽高的其他元素,可见? 2018-04-13 添...

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