当前位置: 首页 > news >正文

做网站群百度官网认证申请

做网站群,百度官网认证申请,动感技术网站建设,网站做留言板进度条控制脚本,支持节点进度条,图片进度条,进度条组件,和进度文字展示 const { ccclass, property, menu } cc._decorator;let text_type cc.Enum({"20%": 0,"1/5": 1,"差值": 2,"自定义…

进度条控制脚本,支持节点进度条,图片进度条,进度条组件,和进度文字展示
在这里插入图片描述
在这里插入图片描述


const { ccclass, property, menu } = cc._decorator;let text_type = cc.Enum({"20%": 0,"1/5": 1,"差值": 2,"自定义": 3,
});
let bar_type = cc.Enum({"Sprite": 0,"ProgressBar": 1,"Node": 2,
});@ccclass
@menu("自定义组件/进度条")
export default class barNode extends cc.Component {@property({type: cc.Sprite,visible() { return this.barType == bar_type.Sprite }})spriteBar: cc.Sprite = null;@property({type: cc.ProgressBar,visible() { return this.barType == bar_type.ProgressBar }})progressBar: cc.ProgressBar = null;@property({type: cc.Node,visible() { return this.barType == bar_type.Node }})nodeBar: cc.Node = null;@property({type: cc.Float,visible() { return this.barType == bar_type.Node }})max: number = 1;@property({type: cc.Float,visible() { return this.barType == bar_type.Node }})min: number = 0;@property(cc.RichText)barDesc: cc.RichText = null;@property(cc.Label)barDesc2: cc.Label = null;@property({type: cc.Enum(bar_type),displayName: "进度条类型"})barType = bar_type.Sprite;@property({type: cc.Enum(text_type),displayName: "进度文字类型"})textType = text_type["1/5"];_width = 0;protected onLoad(): void {}init(value, limit, bar_desc?) {let desc: string = bar_desc || "[0]";let percent = value / limit;percent = percent > 1 ? 1 : percent;if (this.spriteBar && this.barType == bar_type.Sprite) this.spriteBar.fillRange = percent;if (this.progressBar && this.barType == bar_type.ProgressBar) this.progressBar.progress = (percent < 0.1 && percent != 0) ? 0.1 : percent;if (this.nodeBar && this.barType == bar_type.Node) {this.nodeBar.width = (percent && percent * this.max < this.min) ? this.min : percent * this.max;}let str = "";switch (this.textType) {case 0: str = `${this.fixForce(percent * 100, 2)}%`desc = desc.replace("[0]", str);break;case 1: str = `${value}/${limit}`;desc = desc.replace("[0]", str);break;case 2: str = `${limit - value < 0 ? 0 : limit - value}`desc = desc.replace("[0]", str);break;case 3:desc = desc.replace("[0]", value);desc = desc.replace("[1]", limit);break;}if (this.barDesc) this.barDesc.string = desc;if (this.barDesc2) this.barDesc2.string = desc;}fixForce(count, fixTo): string {let a = (count + "").split(".");let b = a[0];if (a.length > 1) b = a[0] + "." + a[1].slice(0, fixTo);if (b == "0.00" && count != 0) {if (a.length > 1) b = a[0] + "." + a[1].slice(0, 4);}return b;}
}
http://www.yidumall.com/news/59886.html

相关文章:

  • 网站开发建app 推广
  • b站推广费用一般多少营销型网站策划书
  • 企业所得税优惠政策2022亚马逊seo是什么意思
  • 涪陵网站建设公司创建站点的步骤
  • 新疆建设工程信息网发布公告为啥不显示南宁百度seo优化
  • 商会网站建设方案怎么推广自己的微信
  • 网站后台无编辑器百度客服人工服务
  • 加强网站党建建设方案google搜索免费入口
  • 开源网站官网seo公司软件
  • 备案网站seo的排名机制
  • 邯郸住房和城乡建设部网站seo检测优化
  • 手机上怎么做微电影网站seo常用工具网站
  • 网站如何做防护seo搜索优化公司排名
  • 东莞制作企业网站公司seo的基本工作内容
  • 做网页和做网站营销方案怎么写?
  • 竞品网站分析自然搜索优化
  • 怎样做网站检索数据分析电商网站设计论文
  • 知乎 做照片好的网站怎么做网络营销推广啊
  • 做同城网站最赚钱营销策略有哪些
  • 专做视频和ppt的网站广州营销优化
  • 商务网站建设与推广实训意义网络推广和竞价怎么做
  • 做网站买阿里云的ecs服务器百度快速排名 搜
  • 外贸营销网站建设公司国内最好的seo培训
  • 成都网络优化公司有哪些深圳专门做seo的公司
  • 柳州正规网站建设加盟株洲网站设计外包首选
  • 丹阳网站建设价位培训机构咨询
  • 手机笑话网站源码慈溪seo排名
  • 安徽建站关键词优化课程
  • 公司做网站需要哪些费用辽宁网站建设
  • 怎么做网站流量统计外贸网站平台哪个好