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

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

1. 鼠标交互-修正交互区域 [ 100%]

...) { createCoralRect(); createDeepSkyblueRect(); createDarkOrchidRect(); // 设置舞台 Laya.stage.name = "暗灰色舞台" Laya.stage.on(Event.MOUSE_DOWN, this, onDown); } function createCoralRect() { var coralRect = new Sprite(); coralRect.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.heigh...

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

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

...Element("video"); Laya.Browser.document.body.appendChild(videoElement); // 设置Video元素地样式和属性 videoElement.style.zInddex = Laya.Render.canvas.style.zIndex + 1; videoElement.src = "../../res/av/mov_bbb.mp4"; videoElement.controls = true; // 阻止IOS视频全屏 videoElement.setAttri...

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

3. 屏幕适配-屏幕适配 [ 96%]

...tion() { // 不支持WebGL时自动切换至Canvas Laya.init(1136, 640); //设置适配模式 Laya.stage.scaleMode = "noscale"; //设置横竖屏 Laya.stage.screenMode = Stage.SCREEN_HORIZONTAL; //设置水平对齐 Laya.stage.alignH = "center"; //设置垂直对齐 Laya.stage.alignV = "middle"; //...

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

4. 文本-复杂的文本样式 [ 92%]

...游戏发行商,面向Flash开发者提供HTML5开发技术方案!"; //设置宽度,高度自动匹配 txt.width = 400; //自动换行 txt.wordWrap = true; txt.align = "center"; txt.fontSize = 40; txt.font = "Microsoft YaHei"; txt.color = "#ff0000"; txt.bold = true; txt.leading = 5; //设置...

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

5. UI-Tree [ 92%]

...../res/ui/tree/clip_selectBox.png", 1, 2); selectBox.name = "selectBox"; //设置 selectBox 的name 为“selectBox”时,将被识别为树结构的项的背景。2帧:悬停时背景、选中时背景。 selectBox.height = 32; selectBox.x = 13; selectBox.left = 12; this.addChild(selectBox); va...

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

6. Sprite-轴心点 [ 91%]

...g", 0, 0); sp1.pos((Laya.stage.width - gap) / 2, Laya.stage.height / 2); //设置轴心点为中心 sp1.pivot(55, 72); Laya.stage.addChild(sp1); //不设置轴心点默认为左上角 sp2 = new Sprite(); sp2.loadImage("../../res/apes/monkey2.png", 0, 0); sp2.pos((Laya.stage.width + gap) / 2, Laya.st...

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

7. 鼠标交互-滑动 [ 91%]

...on.graphics.drawRect(0, 0, w, h, "#FF7F50"); button.pivot(w / 2, h / 2); //设置宽高(要接收鼠标事件必须设置宽高,否则不会被命中) button.size(w, h); button.x = (Laya.stage.width - TrackLength) / 2; button.y = Laya.stage.height / 2; button.on(Event.MOUSE_DOWN, this, onMouse...

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

8. Sprite-新手引导 [ 85%]

...ld(gameContainer); // 引导所在容器 guideContainer = new Sprite(); // 设置容器为画布缓存 guideContainer.cacheAs = "bitmap"; Laya.stage.addChild(guideContainer); gameContainer.on("click", this, nextStep); //绘制遮罩区,含透明度,可见游戏背景 var maskArea = new Sprite();...

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

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

...ain.prototype.onMouseUp = function (evt) { if (this.isDestroyed) { //通过设置 visible=true ,来触发渲染,然后引擎会自动恢复资源 this.spBg.visible = true; this.aniFly.visible = true; this.isDestroyed = false; this.txt.text = "销毁"; } else { //通过设置 visible=false ,来...

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

10. 文本-字数限制 [ 83%]

...xt.width >> 1; inputText.y = Laya.stage.height - inputText.height >> 1; // 设置字体样式 inputText.bold = true; inputText.bgColor = "#666666"; inputText.color = "#ffffff"; inputText.fontSize = 20; inputText.maxChars = 5; Laya.stage.addChild(inputText); } })();module laya { import Input = Laya.I...

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