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

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

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

...便舞台没有任何对象,也会占用这部分内存; * 2. 销毁 Texture 使用的图片资源后,会保留 Texture 壳,当下次渲染时,发现 Texture 使用的图片资源不存在,则自动恢复。 */ var GameMain = /** @class */ (function () { function GameMain() { this.isDest...

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

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

... = "res/bg2.png", PathFly = "res/fighter/fighter.atlas"; class Loader_ClearTextureRes { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Handler = Laya.Handler; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.cli...

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

3. 分享:DrawToCanvas内存释放问题! [ 97%]

...t laya.events.Event; import laya.resource.HTMLCanvas; import laya.resource.Texture; import laya.utils.Browser; import laya.utils.Stat; public class LayaAirDemo { private var sp:Sprite ;//被截屏对象 private var htmlC:HTMLCanvas;//保存截屏后返回的HtmlCanvas对象 private var texture:Textu...

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

4. laya.display.BitmapFont [ 96%]

...用Text.unregisterBitmapFont 时,默认会销毁。 BitmapFont  getCharTexture(char:String):Texture 获取指定字符的字体纹理对象。 BitmapFont  getCharWidth(char:String):Number 获取指定字符的宽度。 BitmapFont  getMaxHeight():Number 获取最大字符高度。 BitmapFont...

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

5. 分享:Dragonbones/Spine的换肤操作 [ 95%]

...准备好的图片放置项目资源目录下,并预加载资源,获取texture 准备好的图片head3.png 放置资源目录下 获取texture Laya.loader.load('head3.png',Handler.create(this,onTextureLoaded)); } private var texture:Texture; private function onTextureLoaded():void { texture=Load...

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

6. laya.display.BitmapFont [ 95%]

...用Text.unregisterBitmapFont 时,默认会销毁。 BitmapFont  getCharTexture(char:String):Texture 获取指定字符的字体纹理对象。 BitmapFont  getCharWidth(char:String):Number 获取指定字符的宽度。 BitmapFont  getMaxHeight():Number 获取最大字符高度。 BitmapFont...

来源: laya_api 发布时间: 20170929

7. 一个关于getPixels的问题 [ 93%]

...下: Main.js: const Sprite = Laya.Sprite; const Text = Laya.Text; const Texture = Laya.Texture;  Laya.init(800, 600);  var txt = new Text(); txt.pos(200, 200); txt.color = "#FFFFFF"; txt.text = "000000"; Laya.stage.addChild(txt);  var spr = new Sprite(); spr.size(50, 50); Laya.stage.addChild(sp...

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

8. 加载-错误处理和进度 [ 91%]

...效。(function() { var Event = Laya.Event; var Loader = Laya.Loader; var Texture = Laya.Texture; var Handler = Laya.Handler; (function() { Laya.init(550, 400); // 无加载失败重试 Laya.loader.retryNum = 0; var urls = ["do not exist", "../../res/fighter/fighter.png", "../../res/legend/map.jpg"]...

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

9. [LayaAirIDE 2.0]TextInput真机输入时显示蓝色字,求解 [ 91%]

...图标 if (input.text.trim().length == 0) { input.changeText(""); sp_icon.texture = Laya.loader.getRes("auth/sp_wrong.png"); switch (input.name) { case "input_nickname": this._arrCheck[0] = false; break; case "input_mobile": this._arrCheck[1] = false; break; case "input_password": this._arrCheck[2] ...

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

10. laya.display.Graphics [ 91%]

...h:Number = 1):DrawCurvesCmd 绘制一系列曲线。 Graphics  drawImage(texture:Texture, x:Number = 0, y:Number = 0, width:Number = 0, height:Number = 0):DrawImageCmd 绘制单独图片 Graphics  drawLine(fromX:Number, fromY:Number, toX:Number, toY:Number, lineColor:String, lineWidth:Number = 1...

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