大约有 397 项符合查询结果, 库内数据总量为 30,903 项。 (搜索耗时: 0.0040 秒)
...的类。 * @return 此类型标识的一个对象。 */ static getItemByClass<T>(sign: string, cls: new () => T): T { if (!Pool._poolDic[sign]) return new cls(); var pool = Pool.getPoolBySign(sign); if (pool.length) { var rst = pool.pop(); rst[Pool.POOLSIGN] = false; } else { rst = new cls...
来源: Laya3.0_文档 发布时间: 20240910
... 测试demo(直接新建项目,拷贝代码即可) // 程序入口 class GameMain{ constructor() { // Laya.init(1280,720); //无问题 Laya.init(1280,720,Laya.WebGL);//有问题 console.log(Laya.version); var testSpriteRotation:PanelRotationTest = new PanelRotationTest(Laya.Sprite); testSpri...
来源: Laya_社区 发布时间: 20170814
...个TextInput组件runtime属性绑定了一个类 绑定了这个类后, class TextInputEx extends Laya.TextInput constructor() { console.log("执行了"); super() ; } // 获取焦点 onFocus() : void { console.log("焦点进入"); // 是否缓存初始的文本提示字符串和文本颜色. if (...
来源: Laya_社区 发布时间: 20181012
...会有突然掉帧的现象,fast模式和slow模式都有这个问题 class Scene_Test { constructor() { super(); Laya.timer.frameLoop(1,this,this.update); } private update() { let dt = Laya.timer.delta / 1000; console.log("dt="+dt); } } 附件中图1是在iphone6上面运行打印的信息,...
来源: Laya_社区 发布时间: 20180808
...该事件进行监听package { import laya.events.EventDispatcher; public class Mod extends EventDispatcher { public function Mod() { super(); } private static var _instance:Mod; public static function get index():Mod { return _instance ||= new Mod(); } public function init():void { Mod.event("aaaa"...
来源: Laya_社区 发布时间: 20161218
... 保存场景后,在RuntimeScript.ts中添加如下代码: const { regClass } = Laya; import { RuntimeScriptBase } from "./RuntimeScript.generated"; @regClass() export class RuntimeScript extends RuntimeScriptBase { onAwake(): void { this.closeBtn.on(Laya.Event.CLICK, this, () => { this.close...
来源: Laya3.0_文档 发布时间: 20240910
...ext = '' + this.count; Laya.timer.loop(1000, this, this.countdown); } Laya.class(countdownBar, "CountdownBar", CountdownUI); return countdownBar; }()); CountdownBar.prototype.countdown = function () { this.count--; if (this.count > 0) { this.countLabel.text = '' + this.count; } else { Laya.timer....
来源: Laya_社区 发布时间: 20171012
...g.changeValue); }); 进度条代码: import Handler = Laya.Handler; export class Onloading extends ui.LoadingUI{ constructor(){ super(); this.loadingBar.changeHandler = new Handler(this, this.onChange); } public changeValue():void{ console.log("change"); ...
来源: Laya_社区 发布时间: 20180524
...); this.alpha = 0; Laya.stage.addChild(this); // this.pos(440,640); } Laya.class(sightBeadSprite, "SightBead", Laya.Sprite); return sightBeadSprite; }());然后如此使用destroy for (var i = 0; i < Laya.stage.numChildren; i++) { var object = Laya.stage.getChildAt(i); // object.removeSelf(); Lay...
来源: Laya_社区 发布时间: 20171012
...置见下图代码和附件DEMO中的TestScene.scene文件 export default class GameUI extends Laya.Scene { constructor() { super(); //设置单例的引用方式,方便其他类引用 GameUI.instance = this; //关闭多点触控,否则就无敌了 Laya.MouseManager.multiTouchEnabled = false; //...
来源: Laya_社区 发布时间: 20190730