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

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

1. 鼠标交互-双指旋转(多点触控) [ 100%]

... Stat.show(); this.setup(); } setup() { this.createSprite(); Laya.stage.on(Event.MOUSE_UP, this, this.onMouseUp); Laya.stage.on(Event.MOUSE_OUT, this, this.onMouseUp); } createSprite() { const Sprite = Laya.Sprite, Event = Laya.Event; let w = 200, h = 300; this.sp = new Sprite(); Laya.stage.addChild...

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

2. 网络和格式-POST [ 99%]

... Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Handler = Laya.Handler, Event = Laya.Event, Accelerator = Laya.Accelerator; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.width, Browser.height, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; La...

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

3. 网络和格式-GET [ 99%]

... Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Handler = Laya.Handler, Event = Laya.Event, Accelerator = Laya.Accelerator; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.width, Browser.height, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; La...

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

4. 鼠标交互-双指缩放(多点触控) [ 99%]

...ya.stage.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { const Event = Laya.Event; this.createSprite(); Laya.stage.on(Event.MOUSE_UP, this, this.onMouseUp); Laya.stage.on(Event.MOUSE_OUT, this, this.onMouseUp); } createSprite() { const Sprite = Laya.Sprite, Event = Laya.Event; let w = 30...

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

5. 鼠标交互-键盘交互 [ 97%]

...mer.frameLoop(1, this, this.keyboardInspector); } listenKeyboard() { const Event = Laya.Event; // 用Set实现更好一些 keyDownList = []; // 添加键盘按下事件,一直按着某按键则会不断触发 Laya.stage.on(Event.KEY_DOWN, this, this.onKeyDown); // 添加键盘抬起事件 Laya.stage...

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

6. 鼠标交互-滑动 [ 94%]

...Sprite(); this.drawTrack(); } createSprite() { const Sprite = Laya.Sprite, Event = Laya.Event; const w = 50; const h = 30; this.button = new Sprite(); this.button.graphics.drawRect(0, 0, w, h, "#FF7F50"); this.button.pivot(w / 2, h / 2); //设置宽高(要接收鼠标事件必须设置宽高,否...

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

7. 屏幕适配-屏幕适配 [ 94%]

... = Laya.Sprite; import Stage = Laya.Stage; import Text = Laya.Text; import Event = Laya.Event; import Image = Laya.Image; import WebGL = Laya.WebGL; export class SmartScale_T { //所有适配模式 private modes: Array = ["noscale", "exactfit", "showall", "noborder", "full", "fixedwidth", "fixedheig...

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

8. 鼠标交互-鼠标交互 [ 93%]

...eractiveTarget(); this.createLogger(); } createInteractiveTarget() { const Event = Laya.Event, Sprite = Laya.Sprite; let rect = new Sprite(); rect.graphics.drawRect(0, 0, 200, 200, "#D2691E"); rect.size(200, 200); rect.x = (Laya.stage.width - 200) / 2; rect.y = (Laya.stage.height - 200) / 2; Laya.st...

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

9. 文本-滚动文本 [ 93%]

...r = "#232628"; this.createText(); } createText() { const Text = Laya.Text, Event = Laya.Event; this.txt = new Text(); Laya.stage.addChild(this.txt); this.txt.overflow = Text.SCROLL; this.txt.text = "Layabox是HTML5引擎技术提供商与优秀的游戏发行商,面向AS/JS/TS开发者提供HTML5...

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

10. 鼠标交互-自定义事件 [ 93%]

...项目开发更高效。const ROTATE = "rotate"; class Interaction_CustomEvent { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Handler = Laya.Handler; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeig...

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