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

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

21. UI-ProgressBar [ 95%]

...progressBar.png"); Laya.stage.addChild(this.progressBar); this.progressBar.width = 400; this.progressBar.x = (Laya.stage.width - this.progressBar.width ) / 2; this.progressBar.y = Laya.stage.height / 2; this.progressBar.sizeGrid = "5,5,5,5"; this.progressBar.changeHandler = new Handler(this, this.on...

来源: Laya2.0_示例 发布时间: 20260303

22. 在父sprite中添加子sprite ,移动父Sprite 子sprite为什么不动? [ 95%]

...l.getBounds(); // 设置位置 this.pos(42,399); this.tower.pos((boundBall.width - boundTower.width)/2+data.tower[towerLel].c1, -data.tower[towerLel].h+data.tower[towerLel].c2); this.aeroboat.pos((boundBall.width - boundTower.width)/2+data.tower[towerLel].c1 - 2*boundAeroboat.width/3 ,-data.tower[to...

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

23. 为什么laya的Button渲染逻辑顺序是先渲染,再获取素材切片? [ 95%]

...his._skin); if (!img){ console.log("lose skin",this._skin); return; }; var width=img.sourceWidth; var height=img.sourceHeight / this._stateNum; img.$_GID || (img.$_GID=Utils.getGID()); var key=img.$_GID+"-"+this._stateNum; var clips=AutoBitmap.getCache(key); if (clips)this._sources=clips; else { thi...

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

24. 最新版本 1.7.5 beta fontClip [ 95%]

...                      this.graphics.drawTexture(te, i * te.width, 0, te.width, te.height);                     } else {                         this.graphics.drawTexture(te, this.width - ((splitArr.length - i) * te.width), 0, te.width, te.height);  ...

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

25. 获取sprite对象的 width和height为0 [ 95%]

获取sprite对象的 width和height为0  /** * 船 */ class Boat extends Laya.Sprite { private bt:Laya.Sprite; constructor() { super() this.bt = new Laya.Sprite() this.bt.loadImage("res/boat.png") this.addChild(this.bt) } } /** * 游戏背景 */ class BackGround extends Laya.Sprite { //背景图 ...

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

26. 性能测试-卡通人物2 [ 95%]

...s.nameLabel.text = "Default"; this.nameLabel.fontSize = 13; this.nameLabel.width = Character.WIDTH; this.nameLabel.align = "center"; this.addChild(this.nameLabel); } setSpeed(value) { this.speed = value; } setName(value) { this.nameLabel.text = value; } update() { this.x += this.speed; if (this.x >=...

来源: Laya2.0_示例 发布时间: 20260303

27. UI-ProgressBar [ 95%]

...progressBar = new ProgressBar("../../res/ui/progressBar.png"); progressBar.width = 400; progressBar.x = (Laya.stage.width - progressBar.width) / 2; progressBar.y = Laya.stage.height / 2; progressBar.sizeGrid = "5,5,5,5"; progressBar.changeHandler = new Handler(this, onChange); Laya.stage.addChild(pr...

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

28. 输入设备-摇一摇 [ 94%]

...keCount = 0; (function() { Laya.init(picW, Browser.height * picW / Browser.width); Laya.stage.scaleMode = Stage.SCALE_SHOWALL; showShakePic(); showConsoleText(); startShake(); })(); function showShakePic() { var shakePic = new Sprite(); shakePic.loadImage("../../res/inputDevice/shake.png"); Laya.sta...

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

29. 性能测试-卡通人物2 [ 94%]

...ss Character function Character(images) { Character.super(this); Character.WIDTH = 110; Character.HEIGHT = 110; var bloodBar; var animation; var nameLabel; Character.prototype.createAnimation = function(images) { animation = new Animation(); animation.loadImages(images); animation.interval = 70; ani...

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

30. 文本-位图字体 [ 94%]

...t = Laya.Stat; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.width, Browser.height, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.loadFont(); } loadFont() { const ...

来源: Laya2.0_示例 发布时间: 20260303