| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- const { ccclass, property } = cc._decorator;
- @ccclass
- /**
- * 提示管理类
- * @author 邹勇
- */
- export default class TipSystem extends cc.Component {
- @property({ type: cc.Integer, displayName: "飘动时间" })
- tween_time: number = 3;
- @property({ type: cc.Integer, displayName: "开始坐标x" })
- src_x: number = 0;
- @property({ type: cc.Integer, displayName: "开始坐标y" })
- src_y: number = 0;
- @property({ type: cc.Integer, displayName: "目标坐标x" })
- tar_x: number = 0;
- @property({ type: cc.Integer, displayName: "目标坐标y" })
- tar_y: number = 100;
- @property({ type: cc.Integer, displayName: "背景透明度" })
- bg_opacity: number = 40;
- @property({ type: cc.Color, displayName: "背景颜色" })
- bg_color: cc.Color = new cc.Color(200, 200, 200);
- @property({ type: cc.Color, displayName: "文本颜色" })
- tip_color: cc.Color = new cc.Color(255, 255, 255);
- @property({ type: cc.Integer, displayName: "文本字体" })
- tip_size: number = 40;
- private labels: cc.Label[];
- onLoad() {
- mk.tip = this;
- this.labels = [];
- }
- start() {
- }
- public async pop(str: string) {
- let node = await mk.pool.getPrefab("game/prefab/tips");
- node.getChildByName("bg")
- console.log(node);
- }
- }
- export enum TipType {
- label = 1,
- }
|