pubtool4pixi
Version:
Usefultool for PIXI xes project
1,341 lines (293 loc) • 15.3 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: BigMath_Timer</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: BigMath_Timer</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>BigMath_Timer<span class="signature">()</span><span class="type-signature"></span></h2>
<div class="class-description">大数学游戏计时组件.</div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="BigMath_Timer"><span class="type-signature"></span>new BigMath_Timer<span class="signature">()</span><span class="type-signature"></span></h4>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>timerEndSound</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">倒计时音频“要抓紧时间了哦~”,自动补全前缀audio_ 默认timerEndSound</td>
</tr>
<tr>
<td class="name"><code>endSoundPercentage</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">百分之几提示音频“要抓紧时间了哦~” 默认0.3</td>
</tr>
<tr>
<td class="name"><code>playEndSound</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">是否播放倒计时音频“要抓紧时间了哦~”</td>
</tr>
<tr>
<td class="name"><code>timeSprite</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">计时器组件资源名称 - 默认:image-gameScene_timer</td>
</tr>
<tr>
<td class="name"><code>textConfig</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">计时器文字配置</td>
</tr>
<tr>
<td class="name"><code>timeCountSound</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">倒计时音效</td>
</tr>
<tr>
<td class="name"><code>textConfig.x</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">文字位置x - 默认:205.45745125612848</td>
</tr>
<tr>
<td class="name"><code>textConfig.y</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">文字位置y - 默认:67.41621621621623</td>
</tr>
<tr>
<td class="name"><code>textConfig.textStyle</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">文字样式 - 默认:{
fontSize: 55,
fill: 0x204931,
fontFamily: "Microsoft Yahei",
fontWeight: "bold",
breakWords: true,
wordWrap: true,
wordWrapWidth: 1120
}</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easy.js.html">easy.js</a>, <a href="easy.js.html#line1609">line 1609</a>
</li></ul></dd>
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>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);</code></pre>
</div>
<h3 class="subsection-title">Extends</h3>
<ul>
<li><a href="BaseContainer.html">BaseContainer</a></li>
</ul>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".continue"><span class="type-signature">(static) </span>continue<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
继续计时
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easy.js.html">easy.js</a>, <a href="easy.js.html#line1809">line 1809</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".pause"><span class="type-signature">(static) </span>pause<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
暂停计时
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easy.js.html">easy.js</a>, <a href="easy.js.html#line1798">line 1798</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".rewind"><span class="type-signature">(static) </span>rewind<span class="signature">(快进时间长度,单位秒)</span><span class="type-signature"></span></h4>
<div class="description">
快进
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>快进时间长度,单位秒</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easy.js.html">easy.js</a>, <a href="easy.js.html#line1830">line 1830</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".rewind"><span class="type-signature">(static) </span>rewind<span class="signature">(快退时间长度,单位秒)</span><span class="type-signature"></span></h4>
<div class="description">
快退
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>快退时间长度,单位秒</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easy.js.html">easy.js</a>, <a href="easy.js.html#line1821">line 1821</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".start"><span class="type-signature">(static) </span>start<span class="signature">(计时长度,单位秒)</span><span class="type-signature"></span></h4>
<div class="description">
开始计时
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>计时长度,单位秒</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easy.js.html">easy.js</a>, <a href="easy.js.html#line1778">line 1778</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".stop"><span class="type-signature">(static) </span>stop<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
停止计时
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easy.js.html">easy.js</a>, <a href="easy.js.html#line1790">line 1790</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Events</h3>
<h4 class="name" id=".event:onTimeRun">onTimeRun</h4>
<div class="description">
fired while timer run.
</div>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>timeleft</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easy.js.html">easy.js</a>, <a href="easy.js.html#line1770">line 1770</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".event:timeup">timeup</h4>
<div class="description">
fired after timer stop.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="easy.js.html">easy.js</a>, <a href="easy.js.html#line1751">line 1751</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Base.html">Base</a></li><li><a href="BaseContainer.html">BaseContainer</a></li><li><a href="BigMath_AniBtn.html">BigMath_AniBtn</a></li><li><a href="BigMath_GuideHand.html">BigMath_GuideHand</a></li><li><a href="BigMath_StarScoreBoard.html">BigMath_StarScoreBoard</a></li><li><a href="BigMath_Timer.html">BigMath_Timer</a></li><li><a href="HitContainer.html">HitContainer</a></li><li><a href="Preschool_aqiu.html">Preschool_aqiu</a></li><li><a href="Preschool_End.html">Preschool_End</a></li><li><a href="Preschool_HintBtn.html">Preschool_HintBtn</a></li><li><a href="Preschool_Start.html">Preschool_Start</a></li><li><a href="PUB_Mask.html">PUB_Mask</a></li></ul><h3>Events</h3><ul><li><a href="BaseContainer.html#.event:beforeHide">beforeHide</a></li><li><a href="BaseContainer.html#.event:beforeShow">beforeShow</a></li><li><a href="BaseContainer.html#.event:Destroyed">Destroyed</a></li><li><a href="BaseContainer.html#.event:onHide">onHide</a></li><li><a href="BaseContainer.html#.event:onShow">onShow</a></li><li><a href="BaseContainer.html#.event:ParentChange">ParentChange</a></li><li><a href="BigMath_AniBtn.html#.event:onClick">onClick</a></li><li><a href="BigMath_Timer.html#.event:onTimeRun">onTimeRun</a></li><li><a href="BigMath_Timer.html#.event:timeup">timeup</a></li><li><a href="Preschool_End.html#.event:gameOver">gameOver</a></li><li><a href="Preschool_Start.html#.event:startGame">startGame</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Wed Dec 18 2019 14:22:09 GMT+0800 (中国标准时间)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>