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

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

1001. LayaFlash针对资源的加载是同步还是异步? [ 79%]

....net.URLRequest; public class Main extends Sprite { public function Main():void { if (stage) init(); else addEventListener(Event.ADDED_TO_STAGE, init); } private function init(e:Event = null):void { removeEventListener(Event.ADDED_TO_STAGE, init); this.stage.scaleMode = StageScaleMode.NO_SCALE; this...

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

1002. 如何与服务端建立连接 [ 79%]

...法 成功失败。。 private function openHandler(event:Object = null):void{//正确建立连接; }private function receiveHandler(msg:Object = null):void{///接收到数据触发函数}private function closeHandler(e:Object= null):void{//关闭事件}private function errorHandler(e:Object = nu...

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

1003. laya.display.Stage [ 79%]

...ode 添加子节点到指定的索引位置。 Node addChildren(... args):void 批量增加子节点 Node clearTimer(caller:*, method:Function):void 清理定时器。功能同Laya.timer.clearTimer()。 Node contains(node:Node):Boolean 当前容器是否包含指定的 Node 节点对象 。 Node...

来源: laya_api 发布时间: 20170929

1004. Android用java原生的切出事件没用 [ 79%]

...,下面给出大概的代码           @Override         public void onActivityStarted(Activity activity) {             //这是切入事件             ConchJNI.RunJS("xxx");         }        @Override         public void onActivityStopped(Activity activity) {   ...

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

1005. UI-ColorPicker [ 79%]

...this, this.onColorPickerSkinLoaded)); } private onColorPickerSkinLoaded(): void { var colorPicker: ColorPicker = new ColorPicker(); colorPicker.selectedColor = "#ff0033"; colorPicker.skin = this.skin; colorPicker.pos(100, 100); colorPicker.changeHandler = new Handler(this, this.onChangeColor, [color...

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

1006. 和原生Dom交互 · LayaAir3.4 · 引擎文档 · LAYABOX [ 79%]

...u8'); hls.attachMedia(video); hls.on(Hls.Events.MANIFEST_PARSED,function():void{ video.play(); }); } plyr.setup(video); } } new LayaUISample; 编译运行代码,发现网页已经可以播放视频了。开发者可能注意到这里我们初始化引擎的时候是这样的: Laya.init(0,0);//...

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

1007. LayaAir和原生DOM交互(TypeScript-2D进阶篇(TS)-扩展模块) [ 79%]

...aya.Sprite(); Laya.stage.addChild(this.qrcodeSp); } private clickHandler():void{ var url:string = this.qrcode._oDrawing._elImage.src;//获取,注意这里是异步的,开发者可以加个延时在获取。 this.qrcodeSp.loadImage(url,0,0,100,100); } } new Main; ``` 编译运行上面的代码...

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

1008. UI-ColorPicker [ 79%]

...this, this.onColorPickerSkinLoaded)); } private onColorPickerSkinLoaded(): void { var colorPicker: ColorPicker = new ColorPicker(); colorPicker.selectedColor = "#ff0033"; colorPicker.skin = this.skin; colorPicker.pos(100, 100); colorPicker.changeHandler = new Handler(this, this.onChangeColor, [color...

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

1009. 计时器-延迟调用 [ 79%]

...ya.stage.bgColor = "#232628"; this.demonstrate(); } private demonstrate(): void { for (var i: number = 0; i < 10; i++) { Laya.timer.callLater(this, this.onCallLater); } } private onCallLater(): void { console.log("onCallLater triggered"); var text: Text = new Text(); text.font = "SimHei"; text.fontS...

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

1010. 加载-单一类型资源加载 [ 79%]

...e(this, this.onAssetLoaded2)); } private onAssetLoaded1(texture: Texture): void { // 使用texture } private onAssetLoaded2(): void { var pic1: Texture = Loader.getRes("res/apes/monkey0.png"); var pic2: Texture = Loader.getRes("res/apes/monkey1.png"); var pic3: Texture = Loader.getRes("res/apes/monk...

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