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

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

61. 音频-播放演示 [ 95%]

...undButton.y; Laya.stage.addChild(musicButton); soundButton.on(Event.CLICK, this, onPlaySound); musicButton.on(Event.CLICK, this, onPlayMusic); } function createButton(label) { var w = 110; var h = 40; var button = new Sprite(); button.size(w, h); button.graphics.drawRect(0, 0, w, h, "#FF7F50"); butt...

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

62. 骨骼动画-适配版Spine [ 95%]

... var SpineTemplet = Laya.SpineTemplet; class SpineBinary { constructor() { this.aniPath = "res/bone/spineboy-pma.skel"; this.index = -1; Laya.init(Browser.width, Browser.height, WebGL); Laya.stage.scaleMode = Stage.SCALE_NOSCALE; Laya.stage.bgColor = "#232628"; Stat.show(); this.startFun(); } startF...

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

63. LayaAir能做RPG吗?不要问我能不能,因为我已经在做 - 杀意来袭 [ 95%]

...class A {  protected _id:number = 1;    public get id():number { return this._id }  public set id(value:number){     this._id = vaule;  } } class B extends A {   public set id(value:number){     this._id = value + 1;   } } class C extends A {  public get id():number { return this._id } ...

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

64. 计时器-延迟执行 [ 95%]

....height - vGap) / 2; Laya.stage.addChild(button1); button1.on(Event.CLICK, this, onDecreaseAlpha1); button2 = createButton("点我60帧之后 alpha - 0.5"); button2.pos(button1.x, button1.y + vGap); Laya.stage.addChild(button2); button2.on(Event.CLICK, this, onDecreaseAlpha2); } function createButto...

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

65. 性能测试-虫子(慎入) [ 95%]

....stage.height + padding * 2); Laya.loader.load(texturePath, Handler.create(this, this.onTextureLoaded)); } onTextureLoaded() { maggotTexture = Laya.loader.getRes(texturePath); this.initMaggots(); Laya.timer.frameLoop(1, this, this.animate); } initMaggots() { let maggotContainer; for (let i = 0; i wb...

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

66. 高级应用-闪光 [ 95%]

..., 0, 0.5); var scaleDelta = 0; var scaleValue = 0; Laya.timer.frameLoop(1, this, loop); function loop() { scaleValue = Math.sin(scaleDelta += 0.01); pos1.elements[0] = pos2.elements[0] = scaleValue * 13; pos1.elements[1] = Math.sin(scaleValue * 20) * 2; pos2.elements[1] = Math.sin(scaleValue * 20) *...

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

67. 滤镜-颜色滤镜 [ 95%]

...; Laya.stage.bgColor = "#232628"; Laya.loader.load(ApePath, Handler.create(this, setup)); })(); function setup() { normalizeApe(); makeRedApe(); grayingApe(); } function normalizeApe() { var originalApe = createApe(); apeTexture = Laya.loader.getRes(ApePath); originalApe.x = (Laya.stage.width - apeT...

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

68. UI-FontClip [ 95%]

...ya.stage.bgColor = "#232628"; Laya.loader.load(assets, Laya.Handler.create(this, this.ShowContent)); } ShowContent() { const FontClip = Laya.FontClip; var clipnum= new FontClip(assets[0]); var fontClip = new FontClip(assets[1]); var TestFontClip = new FontClip(assets[1]); var TestClipNum = new FontC...

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

69. 射线检测-放置物体 [ 95%]

...; meshCollider.mesh = plane.meshFilter.sharedMesh; Laya.timer.frameLoop(1, this, checkHit); var ray = new Laya.Ray(new Laya.Vector3(0, 0, 0), new Laya.Vector3(0, 0, 0)); var point = new Laya.Vector2(); var _outHitInfo = new Laya.RaycastHit(); function checkHit() { //从屏幕空间生成射线 point...

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

70. 加载-销毁Texture使用的图片资源 [ 95%]

...。 */ var GameMain = /** @class */ (function () { function GameMain() { this.isDestroyed = false; this.PathBg = "../../res/bg2.png"; this.PathFly = "../../res/fighter/fighter.atlas"; //初始化引擎 Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDL...

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