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

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

1. 鼠标交互-鼠标交互 [ 100%]

...ar Sprite = Laya.Sprite; var Stage = Laya.Stage; var Text = Laya.Text; var Event = Laya.Event; var Browser = Laya.Browser; var WebGL = Laya.WebGL; var txt; (function() { // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.alignV = Stage.A...

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

2. 鼠标交互-鼠标交互 [ 99%]

...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_示例 发布时间: 20241117

3. sprite点击事件 位置便宜 [ 95%]

...ar Sprite = Laya.Sprite; var Stage = Laya.Stage; var Text = Laya.Text; var Event = Laya.Event; var Browser = Laya.Browser; var WebGL = Laya.WebGL; (function() { // 不支持WebGL时自动切换至Canvas <!--laya-stage--> const canvas = document.getElementById('laya-stage'); Browser.container =...

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

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

... 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_示例 发布时间: 20241117

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

...效。(function() { var Sprite = Laya.Sprite; var Stage = Laya.Stage; var Event = Laya.Event; var Browser = Laya.Browser; var WebGL = Laya.WebGL; var sp; var preRadian = 0; (function() { // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage...

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

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

...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_示例 发布时间: 20241117

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

...效。(function() { var Sprite = Laya.Sprite; var Stage = Laya.Stage; var Event = Laya.Event; var Browser = Laya.Browser; var WebGL = Laya.WebGL; //上次记录的两个触模点之间距离 var lastDistance = 0; var sp; (function() { // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clien...

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

8. Laya.stage.on(Laya.Event.RESIZE,this, this.ChangeSize); [ 94%]

Laya.stage.on(Laya.Event.RESIZE,this, this.ChangeSize); private ChangeSize() {         console.log("---------------")         if(Laya.Browser.window.innerHeight < Laya.Browser.window.innerWidth) {             console.log("横屏")         } else {             console.log(...

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

9. 鼠标交互-滑动 [ 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_示例 发布时间: 20241117

10. 区块地图-滚动地图 [ 94%]

...AirIDE让项目开发更高效。(function() { var Stage = Laya.Stage; var Event = Laya.Event; var TiledMap = Laya.TiledMap; var Rectangle = Laya.Rectangle; var Browser = Laya.Browser; var Handler = Laya.Handler; var Stat = Laya.Stat; var WebGL = Laya.WebGL; var tiledMap; var mLastMouseX = 0; var mL...

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