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

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

1. 区块地图-滚动地图 [ 100%]

...加载完成的回调 */ function completeHandler() { Laya.stage.on(Event.RESIZE, this, resize); resize(); } //鼠标按下拖动地图 function mouseDown() { mLastMouseX = Laya.stage.mouseX; mLastMouseY = Laya.stage.mouseY; Laya.stage.on(Event.MOUSE_MOVE, this, mouseMove); } function mouseMove() { ...

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

2. DOM元素-视频 [ 80%]

...Video的位置,对齐的位置和refence重合 Laya.stage.on(Laya.Event.RESIZE, this, Laya.Utils.fitDOMElementInArea, [videoElement, reference, 0, 0, reference.width, reference.height]);class DOM_Video { constructor() { Laya.init(800, 600); Laya.stage.bgColor = "#FFFFFF"; Laya.stage.alignH = Laya....

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

3. DOM元素-表单输入 [ 73%]

...t.type = "date"; passwordInput.type = "password"; Laya.stage.on(Laya.Event.RESIZE, this, fitDOMElements, [emailInput, birthdayInput, passwordInput]); function showLabel(label,x,y){ var t = new Laya.Text(); t.height = this.rowHeight; t.valign = "middle"; t.fontSize = 15; t.font = "SimHei"; t.text = l...

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

4. 物理引擎-牛顿摆 [ 73%]

...etup(); })(); function setup() { initMatter(); initWorld(); Laya.stage.on("resize", this, onResize); } function initMatter() { var gameWorld = new Sprite(); Laya.stage.addChild(gameWorld); // 初始化物理引擎 engine = Matter.Engine.create( { enableSleeping: true }); Matter.Engine.run(engine); v...

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

5. 照相机-正交相机 [ 72%]

...ate); layaMonkey.transform.position = _translate; Laya.stage.on(Laya.Event.RESIZE, null, function() { camera.convertScreenCoordToOrthographicCoord(pos, _translate); layaMonkey.transform.position = _translate; }); }); class OrthographicCamera { private pos: Laya.Vector3 = new Laya.Vector3(310, 500, 0...

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

6. 物理引擎-布 [ 71%]

...etup(); })(); function setup() { initMatter(); initWorld(); Laya.stage.on("resize", this, onResize); } function initMatter() { var gameWorld = new Sprite(); Laya.stage.addChild(gameWorld); // 初始化物理引擎 engine = Matter.Engine.create( { enableSleeping: true }); Matter.Engine.run(engine); v...

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

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

...输出坐标信息 Laya.stage.on("click", this, onClick); Laya.stage.on("resize", this, onResize); })(); function onBoyClick(e) { //点击后小人会放大缩小 var boy = e.target; if (boy.scaleX === 1) { boy.scale(1.2, 1.2); } else { boy.scale(1, 1); } } function onTxtClick(e) { //点击后切换...

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

8. 其他引擎的Demo-Example_05 [ 68%]

... = Stage.SCALE_FULL; setup(); })(); function setup() { Laya.stage.on(Event.RESIZE, this, onResize); makeObject(0); for (var i = 0; i objs) { current = 0; } makeObject(current); } function makeObject(t) { var xd; var i; switch (t) { case 0: for (i = 0; i tpoint1[i]) { tpoint1[i] = tpoint1[i] + 1; } i...

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

9. 物理引擎-Slingshot [ 52%]

...etup(); })(); function setup() { initMatter(); initWorld(); Laya.stage.on("resize", this, onResize); } function initMatter() { var gameWorld = new Sprite(); Laya.stage.addChild(gameWorld); // 初始化物理引擎 engine = Matter.Engine.create( { enableSleeping: true }); Matter.Engine.run(engine); v...

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