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

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

251. LayaAir下TTF字体的使用方式? [ 73%]

...age { import laya.display.Sprite; import laya.display.Text; import laya.ui.Image; import laya.webgl.WebGL; public class TTFTest { public function TTFTest() { Laya.init(550,400); var sp:Image=new Image(); sp.loadImage("2.png"); Laya.stage.addChild(sp); var text:Text=new Text(); text.fontSize=40; text...

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

252. drawToCanvas截图在某些手机上会变暗 [ 73%]

...显示,实际上我的项目里用的是游戏界面 var snapshot = new Image(); //给个ID方便添加CSS样式 snapshot.id = "snapshot"; //将整个STAGE画到图片里 snapshot.src = Laya.stage.drawToCanvas(1080,1920, 0, 0).getCanvas().toDataURL(); //图片显示在页面中 document.body.appen...

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

253. 我想问下如果要调用手机本地相册,能不能用HTMLDivElement?该怎么用 [ 73%]

...制 file.onload = function(e){ var base64 = e.target.result; var img = new Image();//创建一个图片对象 img.onload = function (){ var canvas = $("#canvas").get(0); var ctx = canvas.getContext("2d"); //使用drawImage显示图片 ctx.drawImage(img,0,0,canvas.width,canvas.height); } //把base64...

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

254. 设置遮罩(JavaScript-LayaAir基础篇(JS)-位图) [ 73%]

...建及资源导入相关文档)* 步骤二:在资源面板拖入一个`Image`组件到场景编辑区,如图4所示 ![图4](img/4.png) (图4) 步骤三:双击进入`Image`组件内部,然后再到组件面板拖入一个`Sprite`组件,如图5所示。 ![图5](img/5.png) (图5) 步...

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

255. list ,增加item ,我想在末尾增加,但是每次都给我翻倍的增加,如何解决 [ 73%]

...增加,如何解决 _proto.room_xinxi=function(){ this.roombg=new Laya.Image($mj.Curr_Game_ImagePath + "hall/room_bg.png"); this.roombg.pos(50,150); this.addChild(this.roombg); var button = new Sprite(); button.loadImage($mj.Curr_Game_ImagePath + "hall/room_jiesan.png"); button.pos(300, 0); this.r...

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

256. List属性详解(ActionScript-IDE篇(AS3)-IDE组件属性详解) [ 73%]

...pt package { import laya.display.Stage; import laya.ui.Box; import laya.ui.Image; import laya.ui.List; import laya.utils.Handler; import laya.webgl.WebGL; public class UI_List { //列表对应图片的路径 private var data:Array = [ "../../../../res/ui/listskins/1.jpg", "../../../../res/ui/listski...

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

257. 在开启webgl模式下,每次运行texture类的getPixels方法内存都会增加 [ 73%]

...aya.Handler export class MaskDemo { private Res: string; private img: Laya.Image; constructor() { //Laya.init(400, 640, Laya.WebGL); //设置舞台背景色 Laya.stage.bgColor = "#ffffff" Laya.Stat.show() //资源路径 this.Res = "test.png"; this.img = new Laya.Image(); this.img.pos(200, 200) //获...

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

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

...定义texture或者layaSprite var roleImg = new Laya.Sprite(); roleImg.loadImage("../xx.png"x,y,width,height);//直接定义roleImg的大小及相对位置 roleImg.zOrder = 2;//还能定义层级,这个层级是与laya直接相关的 role.layaSprite = roleImg; role可以不断传入自定义的lay...

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

259. 新手引导在ios浏览器表现异常 [ 72%]

...uideHitArea: Laya.HitArea;         protected tipContainer: Laya.Image;         constructor() {             super();             this.init();         }         private init() {             this.size(Laya.stage.width,Laya.stage....

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

260. Clip属性详解(ActionScript-IDE篇(AS3)-IDE组件属性详解) [ 72%]

...a.events.Event; import laya.ui.Button; import laya.ui.Clip; import laya.ui.Image; import laya.utils.Handler; import laya.webgl.WebGL; public class UI_Clip { /***控制器按钮资源***/ private var buttonSkin:String = "../../../../res/ui/button-7.png"; /***切片资源***/ private var clipSkin:Stri...

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