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

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

141. 计时器-延迟执行 [ 82%]

...WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; setup(); })(); function setup() { var vGap = 100; but...

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

142. 屏幕适配-缩放-Show All [ 82%]

...ction updateRectPos() { rect.x = Laya.stage.width / 2; rect.y = Laya.stage.height / 2; } })();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; export class SmartScale_Scale_SHOW_ALL { private rect: Sprite; constructor() { Laya.init(550, 400); Laya.stage.scaleMode = Stage.SCALE_S...

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

143. 屏幕适配-缩放-Extract Fit [ 82%]

...ction updateRectPos() { rect.x = Laya.stage.width / 2; rect.y = Laya.stage.height / 2; } })();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; export class SmartScale_Scale_EXTRACT_FIT { private rect: Sprite; constructor() { Laya.init(550, 400); Laya.stage.scaleMode = Stage.SCAL...

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

144. 关于适配noborder模式(个人适配分享及建议) [ 82%]

... 如下 AppConfig.viewRect = {};var divWidth = window.innerWidth; var divHeight = window.innerHeight; var devicePixelRatio = Laya.Browser.pixelRatio; var divH = divHeight * devicePixelRatio; var divW = divWidth * devicePixelRatio; var desH = Laya.stage.height; var desW = Laya.stage.width; //设备...

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

145. list item 添加事件后无法监听 [ 81%]

...神解答     // 初始化ListView function createListView(x, y, width, height, item_width, item_height) {     var list = new Laya.List();     list.itemRender = initItem(item_width, item_height);      list.repeatX = 1;     list.size(width, height);     list.x = x;     list...

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

146. image在相应loaded的时候,无法正确获取高度 [ 81%]

...private init():void { console.log("init", this.x, this.y, this.width, this.height, this.scaleX, this.scaleY); var createOption: any = { isStatic: false, }; this.matterBody = Matter.Bodies.rectangle(this.x, this.y, this.width, this.height, createOption); Matter.World.add(GameMain.instance.engine.worl...

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

147. hitArea用法问题 [ 81%]

...this.closeBtn.x-10,this.closeBtn.y-10,this.closeBtn.width+20,this.closeBtn.height+20,"#FF0000"); let hitA:Laya.HitArea = new Laya.HitArea(); hitA.hit = g; this.closeBtn.hitArea = hitA; // 写法二 this.closeBtn.graphics.drawRect(this.closeBtn.x-10,this.closeBtn.y-10,this.closeBtn.width+20,this.clos...

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

148. 设置cacheAs = bitmap时, drawCanvas 的一个bug [ 81%]

...个bug drawCanvas(canvas: HTMLCanvas, x: number, y: number, width: number, height: number): void { if (!canvas) return; var src: Context = canvas.context as Context; var submit: ISubmit; if (src._targets) { //生成渲染结果到src._targets上 /* this._submits[this._submits._length++] = SubmitCanv...

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

149. laya.display.Sprite [ 81%]

...口,Sprite所有的绘图操作都通过Graphics来实现的。Sprite  height : Number 显示对象的高度,单位为像素,默认为0。 此高度用于鼠标碰撞检测,并不影响显示对象图像大小。需要对显示对象的图像进行缩放,请使用scale、scaleX、scaleY...

来源: laya_api 发布时间: 20170929

150. matter中layasprite怎么改变图片大小? [ 81%]

...以通过getbounds获取显示对象图像的实际高度。</p> */ height: number; 2018-09-04 1 1 分享 微博 QZONE 微信 阿耀 赞同来自: srr5220 role对象有个layaSprite属性,这个layaSprite就是一个普通的sprite对象,改变这个对象的大小即可。 不过要注意...

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