我早就报过到了,不知为啥不能去技术区发问,只能在这问问了。
我不会编程,看官网的指南使用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
|