![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
egret
egret学习 + 踩坑
smileYuWei
记录自己的进步,加油
展开
-
egret 好用的工具类
egret 工具类class GameUtil { /** * 根据name关键字创建一个Bitmap对象。name属性请参考resources/resource.json配置文件的内容。 * Create a Bitmap object according to name keyword.As for the property of name please refer to the configuration file of resources/resource.json.原创 2020-07-21 19:43:15 · 251 阅读 · 0 评论 -
egret重玩游戏:如何重置动画,音频,页面元素
一、游戏前景重玩游戏:需要让游戏页面回到初始化的状态解决的问题:使用egret二、具体代码原创 2020-06-09 19:51:03 · 289 阅读 · 0 评论 -
egret.EventDispatcher(自定义事件的派发与侦听)
一、作用EventDispatcher是egret 的事件派发器类,负责进行过事件的发送和侦听。二、用法EventManager.tsclass EventManager extends egret.EventDispatcher { private static _instance: any; public constructor(target:egret.IEventDispatcher = null) { super(target); } private stati原创 2020-06-09 15:22:16 · 1027 阅读 · 2 评论 -
egret 踩坑日记
1. 页面失去焦点时游戏画面暂停了在Main.ts 里找到如下图所以的代码注释就好了 egret.lifecycle.onPause = () => { egret.ticker.pause(); }2.如何画虚线const drawLine = new egret.Shape();this.addChild(drawLine);// 关键代码开始drawLine....原创 2020-05-07 20:21:29 · 613 阅读 · 0 评论 -
egret 不规则图片涂色,怎么处理呢?
一 游戏的前景交互功能:1.拖拽涂色(在花瓣上按下才可以涂色)2.在指定的花瓣区域内按下才可以涂色,并且不能涂到其他花瓣区域内二 游戏的技术点1.按下鼠标在某一个花瓣内涂色时(就只能在当前区域内涂色),即使移动鼠标到别的区域时,也不会影响到其他区域的颜色要划分要对应的区域把花瓣的svg 转换成对应的坐标 svg转坐标在egret里用egret.Shape根据坐标连线成一个封闭...原创 2020-05-07 19:56:46 · 815 阅读 · 4 评论