moffie 发表于 2021-12-4 11:47:21

为啥我没通过新人报道?我有个关于timebar的问题要咨询

我早就报过到了,不知为啥不能去技术区发问,只能在这问问了。
我不会编程,看官网的指南使用timebar这个等待选项倒计时图框的插件。
调用使用没问题,可是怎么使这个插件消除?使用消除选项没用,硬要等它读完。官网的指南实在看不懂。哪位大佬能指点一二?只要告诉我哪条指令可以消除这个timebar的显示就行。
以下的官网示例:
;调用例子如下:;@timebar bar=bar x=300 y=300 time=5000 width=120 bgimage=barbg bgx=295 bgy=295
@if exp="typeof(global.timebar_object) == 'undefined'"@iscript
class TimeBarPlugin extends KAGPlugin{
      var fore,bgfore;      var timer;      function TimeBarPlugin(seltime)      {                bgfore=new Layer(kag, kag.fore.base);                fore=new Layer(kag, kag.fore.base);                fore.absolute = 2000000-2;                bgfore.absolute = 2000000-3;                timer = new Timer(onTimer, "");                timer.enabled = false;                fore.visible = false;                bgfore.visible = false;      }
      function createTimeBar()      {
                bgfore=new Layer(kag, kag.fore.base);                fore=new Layer(kag, kag.fore.base);                fore.absolute = 2000000-2;                bgfore.absolute = 2000000-3;                fore.visible = false;                bgfore.visible = false;      }
      function setOptions(elm)      {                createTimeBar();                if(typeof(elm.bgimage)!='undefined')                {                              bgfore.visible=true;                        bgfore.loadImages(elm.bgimage);                        bgfore.setSizeToImageSize();                        bgfore.setPos(elm.bgx,elm.bgy);                }                fore.visible=true;                fore.loadImages(elm.bar);                fore.setSizeToImageSize();                fore.setPos(elm.x,elm.y);                timer.enabled = true;                timer.interval = elm.time/(elm.width);      }
      function finalize()      {                invalidate timer;                invalidate fore;      }
      function onTimer()      {                if (fore.imageWidth > 1) fore.imageWidth -= 1;                if (fore.imageWidth == 1)                {                        timer.enabled = false;                        fore.visible = false;                        bgfore.visible = false;                }      }
      function delTimeBar()      {                timer.enabled = false;                fore.visible = false;                bgfore.visible = false;      }
}

kag.addPlugin(global.timebar_object = new TimeBarPlugin(kag));
@endscript
@macro name="timebar"@eval exp="timebar_object.setOptions(mp)"@endmacro

@macro name="deltimebar"@eval exp="timebar_object.delTimeBar(mp)"@endmacro
@endif@return

VariableD 发表于 2021-12-4 20:50:51

您好,不知道为什么您的帖子没有看到,权限已经修改,可以正常发帖了。PS:deltimebar就是删除时间槽指令(。
页: [1]
查看完整版本: 为啥我没通过新人报道?我有个关于timebar的问题要咨询