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

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

411. 屏幕适配-缩放-Show All [ 85%]

...ralRect(); } createCantralRect() { const Sprite = Laya.Sprite; this.rect = new Sprite(); this.rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(this.rect); this.updateRectPos(); } updateRectPos() { this.rect.x = Laya.stage.width / 2; this.rect.y = Laya.stage.height / 2; } } n...

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

412. 分享:DrawToCanvas内存释放问题! [ 85%]

...ow();//显示帧频,用于观察Curmem变化 //添加被截屏对象 sp= new Sprite(); sp.loadImage("bg2.png"); Laya.stage.addChild(sp); //创建DrawToCanvas命令按钮 var btnDraw:Sprite=CreateBtn(100,400); btnDraw.on(Event.CLICK,this,onClickBtnDraw); } //创建按钮 private function CreateBtn(...

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

413. httpRequest send返回Request failed Status:0 [ 85%]

...化引擎 Laya.init(1136, 640); for (var i = 0; i < 4; i++) { var sp = new Laya.Sprite(); var xhr = new Laya.HttpRequest(); var url = "http://thirdqq.qlogo.cn/g%3Fb% ... 3B%3B xhr.once(Laya.Event.COMPLETE, this, this.completeHandler, [url, 1]); xhr.once(Laya.Event.ERROR, this, this.errorHandler);...

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

414. 网络和格式-POST [ 85%]

...olor = "#232628"; connect(); showLogger(); })(); function connect() { hr = new HttpRequest(); hr.once(Event.PROGRESS, this, onHttpRequestProgress); hr.once(Event.COMPLETE, this, onHttpRequestComplete); hr.once(Event.ERROR, this, onHttpRequestError); hr.send('http://xkxz.zhonghao.huo.inner.layabox.co...

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

415. 网络和格式-GET [ 85%]

...olor = "#232628"; connect(); showLogger(); })(); function connect() { hr = new HttpRequest(); hr.once(Event.PROGRESS, this, onHttpRequestProgress); hr.once(Event.COMPLETE, this, onHttpRequestComplete); hr.once(Event.ERROR, this, onHttpRequestError); hr.send('http://xkxz.zhonghao.huo.inner.layabox.co...

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

416. 分享个用美术资源做位图文本的方法。。。 [ 85%]

...ya.Loader.JSON}, {"url":"res/playerKpiFont.png","type":Laya.Loader.IMAGE}],new Laya.Handler(that,function(){ var jsonData = Laya.loader.getRes("res/playerKpiFont.json"); var imageData = Laya.loader.getRes("res/playerKpiFont.png"); // 左中右创建的3个实例 var bp = new BPFont(jsonData,imageDat...

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

417. 3D模式下使用Tween使模型移动如何写法 [ 85%]

...用Tween使模型移动如何写法 //载入并显示鱼模型 var fish = new Laya.MeshSprite3D(Laya.Mesh.load("fish/denglongyu/denglongyuANI-denglongyu.lm")); scene.addChild(fish); var fishmaterial = new Laya.StandardMaterial(); //漫反射贴图 fishmaterial.diffuseTexture = Laya.Texture2D.load("f...

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

418. UI-Tab [ 85%]

...Colors = "#FFFFFF,#8FB299,#FFFFFF"; } function createTab(skin) { var tab = new Tab(); tab.skin = skin; tab.labelBold = true; tab.labelSize = 20; tab.labelStrokeColor = "#000000"; tab.labels = "Tab Control 1,Tab Control 2,Tab Control 3"; tab.labelPadding = "0,0,0,0"; tab.selectedIndex = 1; onSelect(t...

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

419. 代码创建精灵监听不到事件? [ 85%]

...建精灵监听不到事件? var boxstr = "ui/buildsmall.png"; var box = new Laya.Sprite(); var texture = Laya.loader.getRes(boxstr); box.graphics.drawTexture(texture); var arr = {data: StorageRoom.map_storageData[0][0],tag:0}; box.on(Laya.Event.MOUSE_UP,this,this.onclick,[arr]);   var _proto = S...

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

420. SpotLight介绍(TypeScript-3D基础(TS)-LayaAir3D之灯光) [ 85%]

...衰减现象。 ```typescript //聚光灯 var spotLight = scene.addChild(new Laya.SpotLight()) as Laya.SpotLight; //设置聚光灯颜色 spotLight.color = new Laya.Vector3(1, 1, 0); //设置聚光灯位置 spotLight.transform.position = new Laya.Vector3(0.0, 1.2, 0.0); //设置聚光灯方向 var m...

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