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

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

241. list里面可以加入多个view吗? [ 73%]

...{ private var list:List; public function LayaAirDemo() { Laya.init(Browser.width,Browser.height); Laya.stage.bgColor="#EEFFCC"; Laya.loader.load("res/atlas/comp.json",Handler.create(this,onLoaded),null,Loader.ATLAS); } private function onLoaded():void { list=new List(); Laya.stage.addChild(list); li...

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

242. 求问sprite放大后,graphics绘制的图像位置偏移 [ 73%]

...getRes(this.skin_img1); sprite.graphics.drawTexture(texture, 0, 0, texture.width, texture.height); sprite.size(texture.width, texture.height); let x: number = 300; let y: number = 100; let scaleRatio: number = 1.3; sprite.pos(x, y); // sprite.graphics.drawCircle(texture.width/2, texture.height/2, 10...

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

243. laya.ui.Dialog_API3.0 [ 73%]

...bg:Image = new Image("resource/ui/bg.png"); bg.sizeGrid = "40,10,5,10"; bg.width = 150; bg.height = 250; addChild(bg); var image:Image = new Image("resource/ui/image.png"); addChild(image); var button:Button = new Button("resource/ui/btn_close.png"); button.name = Dialog.CLOSE;//设置button的name...

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

244. SVG渐变精灵的扩展脚本继承了多个精灵, 在safari环境下重叠了渲染 [ 73%]

...9/xlink" version="1.1" ';             data += 'viewBox="0 0 ' + this.width + ' ' + this.height + '" ';             // set svg width and height             data += 'width="' + this.width + '" height="' + this.height + '">';             data += '<defs>';          ...

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

245. HTMLDivElement中image标签多次赋值报错 [ 73%]

...tion() { // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = "showall"; Laya.stage.bgColor = "#232628"; setup(); })(); function setup() { createPa...

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

246. 2.3.0截屏问题 [ 72%]

...ublic saveImg() { let htmlCanvas: any = Laya.stage.drawToCanvas(Laya.stage.width, Laya.stage.height, 0, 0); let canvas: any = htmlCanvas.sourse; canvas.toTempFilePath({ x: 100, y: 200, width: 50, height: 50, destWidth: 100, destHeight: 100, fileType: "png", quality: 1.0, success: (res) => { conso...

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

247. ios上input无法隐藏 [ 72%]

...建input             z_file.style="filter:alpha(opacity=0);opacity:0;width: 29%;height:11%;";             z_file.type ="file";//设置类型是file类型。             z_file.id ="z_sfz";//设置ID。             z_file.accept="image/*";//设置文件的格式为png;    ...

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

248. iPhone 6p\7p 屏幕适配问题 [ 72%]

...如图这种适配问题 适配方案是这样的: const GAME_CONFIG = { WIDTH: 1334, HEIGHT: 750, SCREEN_MODE: Laya.Stage.SCREEN_HORIZONTAL, //可选自动横屏:Laya.Stage.SCREEN_HORIZONTAL 或者 自动竖屏:Laya.Stage.SCREEN_VERTICAL SCALE_MODE: Laya.Stage.SCALE_FIXED_WIDTH, //自动横屏时...

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

249. JS进度条加载问题 [ 72%]

...w Laya.Sprite(); progressBar.loadImage("comp/BG1.jpg",50,300); progressBar.width=300; progressBar.sizeGrid="5,5,5,5"; progressBar.changeHandler=new Handler(this,onChange); //当progressBar的value值改变时触发 Laya.stage.addChild(progressBar); onchange(); } function onChange(value) { trace("进...

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

250. [LayaAir2] 在使用videoDom创建视频元素后iPad跟iPhone中位置不一样 [ 72%]

...eo.loop = true; var texture2D = new Laya.Texture2D(videoTexture.video.videoWidth,videoTexture.video.videoHeight); var texture:Laya.Texture = new Laya.Texture(texture2D); var image:Laya.Image = new Laya.Image(); image.texture = texture; image.width = videoTexture.video.videoWidth; image.height = vide...

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