Class: BigMath_Timer

BigMath_Timer()

大数学游戏计时组件.

Constructor

new BigMath_Timer()

Properties:
Name Type Description
timerEndSound string 倒计时音频“要抓紧时间了哦~”,自动补全前缀audio_ 默认timerEndSound
endSoundPercentage number 百分之几提示音频“要抓紧时间了哦~” 默认0.3
playEndSound boolean 是否播放倒计时音频“要抓紧时间了哦~”
timeSprite string 计时器组件资源名称 - 默认:image-gameScene_timer
textConfig object 计时器文字配置
timeCountSound string 倒计时音效
textConfig.x number 文字位置x - 默认:205.45745125612848
textConfig.y number 文字位置y - 默认:67.41621621621623
textConfig.textStyle object 文字样式 - 默认:{ fontSize: 55, fill: 0x204931, fontFamily: "Microsoft Yahei", fontWeight: "bold", breakWords: true, wordWrap: true, wordWrapWidth: 1120 }
Source:
Example
import {Easy} from "pubtool4pixi"
let timer = Easy.create("BigMath_Timer",{
  parentContainer:stage
});
timer.show();
timer.start(800);
timer.addEventOnce("timeup",()=>{
    console.log("timeup");
});
setTimeout(()=>{
    timer.stop();
},1000);

Extends

Methods

(static) continue()

继续计时
Source:

(static) pause()

暂停计时
Source:

(static) rewind(快进时间长度,单位秒)

快进
Parameters:
Name Type Description
快进时间长度,单位秒 number
Source:

(static) rewind(快退时间长度,单位秒)

快退
Parameters:
Name Type Description
快退时间长度,单位秒 number
Source:

(static) start(计时长度,单位秒)

开始计时
Parameters:
Name Type Description
计时长度,单位秒 number
Source:

(static) stop()

停止计时
Source:

Events

onTimeRun

fired while timer run.
Properties:
Name Type Description
timeleft number
Source:

timeup

fired after timer stop.
Source: