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

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

21. Sprite中的width,height和size(width,height)感觉没作用啊 [ 77%]

... function Init(){ Laya.init(800,600); bg = new laya.display.Sprite(); bg.loadImage("res/bg.png"); bg.pos(0,0); bg.width = 100; bg.height = 100; bg.size(100,100); Laya.stage.addChild(bg); } 2016-07-11 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容...

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

22. laya.display.Graphics [ 76%]

...(比较耗CPU,频繁使用会造成卡顿,尽量少用)。 Graphics  loadImage(url:String, x:Number = 0, y:Number = 0, width:Number = 0, height:Number = 0, complete:Function = null):void 加载并显示一个图片。 Graphics  restore():RestoreCmd 返回之前保存过的路径状态和属...

来源: Laya2.0_api 发布时间: 20190513

23. scrollRect 改变后子对象的鼠标事件失效 [ 74%]

...失效 bg=new Laya.Sprite(); Laya.stage.addChild(bg); bg.size(800,600); bg.loadImage("aa_1.Png",0,0,800,600); poly=new Laya.Sprite(); bg.addChild(poly); poly.size(36,36); poly.pivot(18,18); poly.loadImage("SafeExitL.png",0,0,36,36); poly.pos(400,300); poly.on("mousedown", this, polyonMouseDown); bg....

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

24. laya.display.Animation [ 74%]

...画的播放实质就是定时切换Graphics对象。 使用set source、loadImages(...)、loadAtlas(...)、loadAnimation(...)方法可以创建动画模版。使用play(...)可以播放指定动画。 Public Properties Hide Inherited Public Properties Show Inherited Public Properties PropertyDefin...

来源: Laya2.0_api 发布时间: 20190513

25. 画出来鼠标轨迹线 [ 74%]

...获得遮罩层 //给两个老婆穿上衣服,并出现在舞台上 img1.loadImage("bg.jpg"); img2.loadImage("bg.jpg"); Laya.stage.addChild(img2); Laya.stage.addChild(img1); //给两个老婆穿上衣服,并出现在舞台上 //鼠标移动时触发的mousemove事件 function mousemove(){    ...

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

26. 续飞机大战 [ 73%]

...背景1 this.bg1 = new Laya.Sprite(); //加载并显示背景图 this.bg1.loadImage("war/background.png"); //把背景1放到容器内 this.addChild(this.bg1); //创建背景2 this.bg2 = new Laya.Sprite(); //加载并显示背景图 this.bg2.loadImage("war/background.png"); //更改背景2,放到...

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

27. 关于定位的问题 [ 73%]

...代码生成一个图片 例如 var btnJump = new Laya.Sprite(); btnJump.loadImage('res/btn_jump.png'); Laya.stage.addChild(btnJump); 请问 不管屏幕是竖屏还是横屏 如何设置这个按钮的位置一直在右下角   2017-08-01 添加评论 免费帖 --> 分享 微博 QZONE 微信 没...

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

28. sprite添加click监听事件反应迟钝 [ 73%]

...awyuan.graphics.drawCircle(0,0,50,"#232628");//反应非常迟钝 drawyuan.loadImage("../laya/assets/comp/textinput.png");//反应没有问题 drawyuan.size(100, 100); var x = Math.random() * Laya.stage.width; var y = Math.random() * Laya.stage.height; console.log(x + "" + y); drawyuan.pos(x,y); ret...

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

29. 滤镜的集中实现 [ 71%]

...te(); //添加到舞台 Laya.stage.addChild(Img); //加载显示图片 Img.loadImage("res/tt.png",w,h); return Img; } /**创建红色滤镜位图方法**/ function creteRedFilter(){ //颜色滤镜矩阵,红色 var colorMatrix = [ 1, 0, 0, 0, 0, //R 0, 0, 0, 0, 0, //G 0, 0, 0, 0, 0, //B 0, 0, 0, 1, 0...

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

30. 创建多个Sprite对象后,再次取出来的时候坐标全为0,0高宽跟创建时的也不一样 [ 70%]

...bg_" + nums; userBoxSprite.addChild(sb); userBoxSprite.addChild(sp); // sb.loadImage(newBg1, x, y, singleWidth, singleHeight); sb.skin = newBg1; sb.pos(x,y); sb.size(singleWidth, singleHeight); // sp.loadImage(imgUrl, x, y, singleWidth, singleHeight); sp.skin = imgUrl; sp.pos(x,y); sp.size(singleWid...

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