| 赞 | 3 |
| VIP | |
| 好人卡 | |
| 积分 | 1 |
| 经验 | |
| 最后登录 | 2018-11-11 |
| 在线时间 | 306 小时 |
- 梦石
- 0
- 星屑
- 60
- 在线时间
- 306 小时
- 注册时间
- 2014-8-5
- 回帖
- 403
|
发表于 2015-12-10 13:26:00
|
显示全部楼层
本帖最后由 夏末渐离 于 2015-12-10 13:29 编辑
如果你只是想一直隐藏计时器的数字。那么以下代码就可以了:
[fold][pre lang="javascript"]
var ControlTime_20151210=Sprite_Timer.prototype.updateVisibility;
Sprite_Timer.prototype.updateVisibility=function()
{
ControlTime_20151210.call(this);
this.visible=false;
}[/pre][/fold]
如果你想通过开关控制计时器数字的显示或隐藏,那么你可以用以下代码:
说明如下:
1,你需要在F10插件管理器设置控制的开关,默认为1号开关。
2.当这个开关为On时则使计时器数字被隐藏,反之则显示计时器的数字。
[fold][pre lang="javascript"]
/*:
* @param switch number
* @desc please set a switch number to draw this HUD when the switch on;
* @default 1
*/
(function()
{
var parameters = PluginManager.parameters('ControlTime');
var SwitchNum=Number(parameters['switch number'])||1;
var ControlTime_20151210=Sprite_Timer.prototype.updateVisibility;
Sprite_Timer.prototype.updateVisibility=function()
{
ControlTime_20151210.call(this);
if($gameSwitches.value(SwitchNum)&&this.visible)
this.visible=false;
if(!$gameSwitches.value(SwitchNum)&&!this.visible)
this.visible=true;
}
})();[/pre]
[/fold]
|
评分
-
查看全部评分
|