大约有 257 项符合查询结果, 库内数据总量为 31,722 项。 (搜索耗时: 0.0051 秒)
Laya_社区(103) Laya3.0_api(56) Laya2.0_文档(32) Laya2.0_示例(27) Laya_示例(24) Laya3.0_文档(14) Laya2.0_api(1)
.../monkey2.png",0,0,0,0,Laya.Handler.create(this,function() { console.log(sp.width,sp.height); })); Laya.stage.addChild(sp); ``` loadImage在加载完成的回调函数触发之后才可以正确获取宽高。 1. **直接调用size设置:** ```typescript Laya.loader.load("res/apes/monkey2.png",Laya...
来源: Laya2.0_文档 发布时间: 20210714
... dialogUI,怎么在页面中打开? this.wrong=new ui.wrongUI; this.wrong.width=300; this.wrong.height=200; this.wrong.x=50; this.wrong.y=100; this.doworkui.addChild(this.wrong); doworkui是我的一个UI,我要在这个面中打开一个对话框. wrongUI是我创建的 对话框 我现在这个对...
来源: Laya_社区 发布时间: 20171027
...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
...te_:Sprite = new Sprite(); var bitmap_:BitmapData = new BitmapData(_loader.width, _loader.height); bitmap_.draw(_loader, new Matrix()); var matrix:Matrix = new Matrix(); matrix.rotate(Math.PI/4); sprite_.graphics.beginBitmapFill(bitmap_, matrix, true); sprite_.graphics.drawRect(100, 50, 200, 90); sp...
来源: Laya_社区 发布时间: 20170414
...显示截屏后的纹理 public function LayaAirDemo() { Laya.init(Browser.width, Browser.height);//引擎初始化 Laya.stage.bgColor = "#ffcccc";//背景颜色 Stat.show();//显示帧频,用于观察Curmem变化 //添加被截屏对象 sp= new Sprite(); sp.loadImage("bg2.png"); Laya.stage.addChi...
来源: Laya_社区 发布时间: 20170822
...assets/comp/haoyuobang-hui.png"; var img = new Laya.Sprite(); //实例 img.width = 300; //宽高 img.height = 200; switchImg(); img.on(Laya.Event.CLICK, this, switchImg) //点击事件 Laya.stage.addChild(img); function switchImg() { img.graphics.clear(); //清除绘制 var imgUrl = (this.flag = !th...
来源: Laya_社区 发布时间: 20180502
...没有生效 Laya.init(640, 1136); let testSp = new Laya.Sprite(); testSp.width = 200; testSp.height = 50; testSp.graphics.clear(); testSp.graphics.drawRect(0, 0, testSp.width, testSp.height,'#FF0000'); let tmpMask = new Laya.Sprite(); tmpMask.width = testSp.width; tmpMask.height = testSp.height; tm...
来源: Laya_社区 发布时间: 20200421
...显示对象的中心,显示位置在可拖拽区域之内 sp.pivot(sp.width/2,sp.height/2); sp.pos(250,450); Laya.stage.addChild(sp); //为需要滑动的对象添加down,down下开始move,up时移除move和up事件 sp.on(Event.MOUSE_DOWN,this,onDown); Laya.stage.on(Event.MOUSE_UP,this,onUp);...
来源: Laya_社区 发布时间: 20170106
...ideoElement.setAttribute('preload', 'preload'); videoElement.setAttribute('width', '100%'); videoElement.setAttribute('height', '100%'); // videoElement.playbackRate = 2;//加速播放 // 设置画布上的对齐参照物 reference = new Sprite(); this.addChild(reference); reference.pos(0, 0); refer...
来源: Laya_社区 发布时间: 20180313
...ded():void { this.init(); } private init():void { this.mBitmapFont.setSpaceWidth(10); Laya.Text.registerBitmapFont(this.mFontName, this.mBitmapFont); var txt:Laya.Text = new Laya.Text(); txt.text = "武器坐骑角色"; txt.width = 250; txt.height = 250; txt.wordWrap = true; txt.align = "center"; tx...
来源: Laya_社区 发布时间: 20171028