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

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

121. 分享:图集资源做位图文本的工具类(知道fontclip组件的可以略过了,之前一直没注意到这个组件) [ 97%]

...tring, width: number, align: string = "left",padding: number=0) { super(); this.width = width; this.resFix = resFix; this._align = align; this._padding = padding; } /** * 字间距 */ public set padding(v: number){ if(v === this._padding){return;} this._padding = v; if(this.text){ this.createFnt(thi...

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

122. 输入设备-地图 [ 97%]

...2628"; // 本地运行,需要在index.html中引用百度地图API文件 this.createDom(); this.initMap(); this.createInfoText(); let successHandler = new Handler(this, this.updatePosition); let errorHandler = new Handler(this, this.onError); // 使用高精度位置 Geolocation.enableHighAccuracy...

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

123. Laya中Button等组件lose skin的问题 [ 97%]

...hangeClips。 __getset(0,__proto,'skin',function(){         return this._skin;         },function(value){         if (this._skin !=value){             this._skin=value;             this.callLater(this.changeClips);             this._setStat...

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

124. 屏幕适配-屏幕适配 [ 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_示例 发布时间: 20251130

125. 其他引擎的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_示例 发布时间: 20251130

126. 鼠标交互-拖动 [ 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_示例 发布时间: 20251130

127. 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

128. 鼠标交互-键盘交互 [ 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_示例 发布时间: 20251130

129. 使用百度地图显示当前位置(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

130. 全局动画不能加载 [ 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