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

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

1. Sprite-显示图片 [ 100%]

...TypeScript三种开发语言、LayaAirIDE让项目开发更高效。class Sprite_DisplayImage { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage; // 2D场景显示时打开 Laya.Config.isAntialias = true; // 2D场景显示错乱时打开 Laya.Config.useWebGL2 =...

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

2. 输入设备-指南针 [ 91%]

...nge); } // 方位指示器指向当前所朝方位 createCompass() { const Sprite = Laya.Sprite; compassImg = new Sprite(); Laya.stage.addChild(compassImg); compassImg.loadImage(compassImgPath); compassImg.pivot(compassImg.width / 2, compassImg.height / 2); compassImg.pos(Laya.stage.width / 2, 400);...

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

3. Sprite-节点控制 [ 91%]

...TypeScript三种开发语言、LayaAirIDE让项目开发更高效。class Sprite_NodeControl { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage; // 支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.align...

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

4. Sprite-切换纹理 [ 89%]

...1.png", monkey2Str = "res/apes/monkey2.png", monkey1Res, monkey2Res; class Sprite_SwitchTexture { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage; // 支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.al...

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

5. 鼠标交互-修正交互区域 [ 88%]

...stage.on(Event.MOUSE_DOWN, this, this.onDown); } createCoralRect() { const Sprite = Laya.Sprite, Event = Laya.Event; let coralRect = new Sprite(); coralRect.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height / 2, "#FF7F50"); //设置名称 coralRect.name = "珊瑚色容器"; coralRect.size(...

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

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

...Laya.stage.bgColor = "#232628"; Stat.show(); this.init(); } init() { const Sprite = Laya.Sprite, Animation = Laya.Animation, Text = Laya.Text, Event = Laya.Event; // 创建背景 this.spBg = Sprite.fromImage(PathBg); Laya.stage.addChild(this.spBg); // 创建动画 this.aniFly = new Animation(); this...

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

7. DOM元素-表单输入 [ 79%]

...e = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#fff"; this.form = new Laya.Sprite(); this.form.size(250,120); this.form.pos((Laya.stage.width - this.form.width) / 2, (Laya.stage.height - this.form.height) / 2); Laya.stage.addChild(this.form); this.rowHeight = 30; this.rowSpacing = 10; let rowHeightD...

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