|
|
@@ -1,9 +1,18 @@
|
|
|
+import { RewardType } from "../../data/GameData";
|
|
|
+
|
|
|
|
|
|
const { ccclass, property } = cc._decorator;
|
|
|
/**
|
|
|
* 世界公告 滚动播放
|
|
|
* @author 邹勇
|
|
|
*/
|
|
|
+
|
|
|
+const ScrollType = cc.Enum({
|
|
|
+ ST_horizontal : 0,
|
|
|
+ ST_vertical : 1,
|
|
|
+});
|
|
|
+
|
|
|
+
|
|
|
@ccclass
|
|
|
export default class TweenCast extends cc.Component {
|
|
|
@property({ type: cc.RichText, displayName: "公告内容" })
|
|
|
@@ -14,6 +23,8 @@ export default class TweenCast extends cc.Component {
|
|
|
private move_speed: number = 3;
|
|
|
@property({ displayName: "等待时间" })
|
|
|
private wait_time: number = 10;
|
|
|
+ @property({displayName: '滚动方向', type: ScrollType})
|
|
|
+ private scrollType = ScrollType.ST_horizontal;
|
|
|
|
|
|
private names: string[] = ["拒绝寂寞", "孽緣", "祗為与妳相爱", "羙男", "浅蓝", "腊笔小东", "卡布奇诺", "苊狠幸福", "埋葬回忆", "早已该放手", "白兎",
|
|
|
"豿疍疍", "宿命", "渗透的葬礼", "全都是虚假", "俄侑伱-直", "隱裑", "你不配我", "非主流网名", "剧终", "如果沵走了", "續雪", "默默然", "大白痴", "衮开",
|
|
|
@@ -54,16 +65,33 @@ export default class TweenCast extends cc.Component {
|
|
|
|
|
|
private rickPlay() {
|
|
|
this.node.active = true;
|
|
|
- cc.tween(this.rich_text.node)
|
|
|
+ if(this.scrollType == ScrollType.ST_horizontal)
|
|
|
+ {
|
|
|
+ cc.tween(this.rich_text.node)
|
|
|
.to(this.move_speed, { x: 16 })
|
|
|
.delay(this.display_time)
|
|
|
.to(this.move_speed, { x: -450 })
|
|
|
.call(this.play.bind(this)).start();
|
|
|
+ }else{
|
|
|
+ cc.tween(this.rich_text.node)
|
|
|
+ .to(this.move_speed, { y: 0 }, cc.easeSineOut())
|
|
|
+ .delay(this.display_time)
|
|
|
+ .to(this.move_speed, { y: 50 })
|
|
|
+ .call(this.play.bind(this)).start();
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private reset() {
|
|
|
this.node.active = false;
|
|
|
- this.rich_text.node.x = 450;
|
|
|
- this.rich_text.string = this.getContent();
|
|
|
+ if(this.scrollType == ScrollType.ST_horizontal)
|
|
|
+ {
|
|
|
+ this.rich_text.node.x = 450;
|
|
|
+ this.rich_text.string = this.getContent();
|
|
|
+ }else{
|
|
|
+ this.rich_text.node.y = -50;
|
|
|
+ this.rich_text.string = this.getContent();
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|