当前位置:网站首页>白鹭egret添加新页面教程,如何添加新页面
白鹭egret添加新页面教程,如何添加新页面
2022-08-05 05:25:00 【花花省】
上一个教程中讲解了如何引入图片,如果图片作为一个按钮,点开一个跳转页面,怎么处理
1.首先打开需要引入的页面的ts文件定义一个按钮,比如我们定义为private btnXxl:eui.Button;
免费的egret视频学习资料
关注技术公众号【清兮科技】回复【egret】免费获取
2.写点击动作,打开下面的onTouchTap方法,加入点击事件,这里我们作为打开和主页面一样的界面的方式来实现,这里称之为切换游戏场景,使用SceneManager.instance.runScene(HuhuScene);方法切换游戏场景
3.新建ts文件,她继承于scenebase
4.新建exml文件 ,这里的模板自己写好(可自定义拖拽布局)
5.添加好了模板以后还需要再添加几个引入,首先是exml.e.d.ts
然后是打开manifest.json
然后再打开default.thm.json,添加一行代码,引入exml文件
在游戏项目根目录下添加引入js文件,因为项目执行debug的时候会生成相应的js
引入完成这些一个新的页面就可以打开了,如果需要打开一个弹出框,跟上面步骤几乎一样,
只是引入的ts文件最好是放在/src/layer/panel目录下
引入的exml模板文件放在resource/eui_skins/layer/panel目录下
然后使用UIManager.instance.popPanel打开弹出层!!!
边栏推荐
- input detailed file upload
- D45_Camera assembly Camera
- el-autocomplete使用
- ev加密视频转换成MP4格式,亲测可用
- link 和@improt的区别
- Pytorch分布式并行处理
- 多行文本省略
- Error correction notes for the book Image Processing, Analysis and Machine Vision
- May I ask how to read the binlog of the two tables of hologres through flink sql, and then how to join?
- NACOS Configuration Center Settings Profile
猜你喜欢

The 25 best free games on mobile in 2020

干货!教您使用工业树莓派结合CODESYS配置EtherCAT主站

Q 2020, the latest senior interview Laya soul, do you know?

文件内音频的时长统计并生成csv文件

邮件管理 过滤邮件

Detailed explanation of the construction process of Nacos cluster

docker部署完mysql无法连接

Transformer详细解读与预测实例记录
![[issue resolved] - jenkins pipeline checkout timeout](/img/3d/c14276d2b5ce18fc3d1288abb059c0.png)
[issue resolved] - jenkins pipeline checkout timeout

多行文本省略
随机推荐
Mina's long and short connections
NB-IOT智能云家具项目系列实站
Matplotlib绘图笔记
ROS2下使用ROS1 bag的方法
LaTeX笔记
The 25 best free games on mobile in 2020
花花省V5淘宝客APP源码无加密社交电商自营商城系统带抖音接口
VRRP overview and experiment
Billions of IT operations in the market, the product by strength to speak
VSCode编写OpenCV
D46_Force applied to rigid body
Take you in-depth understanding of cookies
Next-Generation Parsing Technology - Cloud Parsing
[问题已处理]-jenkins流水线checkout超时
图像处理、分析与机器视觉一书纠错笔记
干货!教您使用工业树莓派结合CODESYS配置EtherCAT主站
Some basic method records of commonly used languages in LeetCode
D39_ coordinate transformation
【FAQ】CCAPI兼容EOS相机列表(2022年8月 更新)
Programmers should understand I/O this way