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

大约有 121 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 0.0045 秒)

41. 分享一下自己的屏幕适配方案 [ 80%]

分享一下自己的屏幕适配方案 废话不多说 上代码 Laya.stage.scaleMode = Laya.Stage.SCALE_FULL nWidth:number; nHeight:number; ImgX:number; ImgY:number; Img:Laya.Image =new Laya.Image(); this.nWidth =this.bg.width; //背景图宽 this.nHeight =this.bg.height;//背景图的高 this....

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

42. BackGround.super(this);这个报错 Cannot read property 'call' of undefined [ 80%]

... (function shouye(){ Laya.init(100,300); this.bgimg=new BackGround(); Laya.stage.addChild(this.bgimg); })(); return shouye; })(); var BackGround = (function (_super) { function BackGround() { BackGround.super(this); this.bg=new Laya.sprite; this.bg.loaImage("war/beijing.png"); this.addchild(this.b...

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

43. 飞机大战js源码中判断语句问题 [ 79%]

...放背景图。 box = new Sprite(); //把这容器添加到舞台。 Laya.stage.addChild(box); //创建背景1 bg1 = new Sprite(); //加载并显示背景图1 bg1.loadImage("res/background.png"); //把背景1添加到容器 box box.addChild(bg1); //创建背景2 bg2 = new Sprite(); //加载并显示...

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

44. laya.ui.Image_API3.0 [ 79%]

...n Image_Example() { Laya.init(640, 800);//设置游戏画布宽高。 Laya.stage.bgColor = "#efefef";//设置画布的背景颜色。 onInit(); } private function onInit():void { var bg:Image = new Image("resource/ui/bg.png");//创建一个 Image 类的实例对象 bg ,并传入它的皮肤。 bg.x ...

来源: Laya3.0_api 发布时间: 20231115

45. 图片居中的问题 [ 79%]

...自: var bg = new Laya.Sprite(); bg.loadImage("res/bg-480x720.jpg"); Laya.stage.on(Laya.Event.RESIZE,this,onResize);   function onResize() {     var scale,scaleX,scaleY;     scaleX = Browser.clientWidth/480;     scaleY = Browser.clientHeight/720;     scale = scaleX > scaleY ? scaleX : sc...

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

46. 请问图片大小可以手动设置宽高吗?怎么设置,看到API里的Sprite的width和height无法设置,只用于碰撞检测 [ 78%]

...ian 赞同来自: this.bg_img.skin = "ui/bg.jpg"; this.bg_img.width = Laya.stage.width; this.bg_img.height = Laya.stage.height; Image使用skin修改显示,改变宽高时,会拉伸显示内容 2018-01-22 0 0 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 要回复问题请...

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

47. 问一下这个问题要怎么改啊? [ 78%]

...(); pic.graphics.drawTexture(Laya.loader.getRes(picUrl), picX, picY); Laya.stage.addChild(pic); } } }   Main.as package { import laya.display.*; import laya.resource.Texture; import laya.ui.Image; import laya.utils.Handler; import addPic; public class Main { private var bgImage:Image; private var b...

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

48. 不规则图形遮罩 显示出来的内容与画的遮罩图形不相同 [ 78%]

...          bg.loadImage("pic/2.jpg",0,0);             Laya.stage.addChild(bg);             maskSP = new Sprite();             maskSP.graphics.drawPath(0, 0,maskSPArr, {fillStyle: "#00ffff"});             bg.mask = maskSP; Laya.stage.addChild(maskSP); 显示...

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

49. 如何用代码控制panel的vscroll滚动幅度 [ 77%]

...ass LayaAirDemo { public function LayaAirDemo() { Laya.init(600,600); Laya.stage.bgColor='#EEFFCC'; Laya.loader.load("res/atlas/comp.json",Handler.create(this,onLoaded),null,Loader.ATLAS); } private function onLoaded():void { //panel 切记设置宽高,否则panel不显示 var panel:Panel=new Pane...

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

50. 物理Bodies绑定Laya.Sprite [ 77%]

...画布,使用 WebGL 渲染,不支持时会自动切换为 Canvas Laya.stage.alignV = 'top'; // 适配垂直对齐方式 Laya.stage.alignH = 'middle'; // 适配水平对齐方式 Laya.stage.screenMode = this.Stage.SCREEN_HORIZONTAL; // 始终以横屏展示 Laya.stage.scaleMode = "fixedwidth"; //...

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