THE NVL Maker

 找回密码
 注册
搜索
查看: 4351|回复: 1

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

[复制链接]

2

主题

2

帖子

0

精华

游戏开发者

积分
2
发表于 2021-12-4 11:47:21 | 显示全部楼层 |阅读模式
我早就报过到了,不知为啥不能去技术区发问,只能在这问问了。
我不会编程,看官网的指南使用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


回复

使用道具 举报

16

主题

982

帖子

0

精华

管理员

Rank: 9Rank: 9Rank: 9

积分
1003
发表于 2021-12-4 20:50:51 | 显示全部楼层
您好,不知道为什么您的帖子没有看到,权限已经修改,可以正常发帖了。PS:deltimebar就是删除时间槽指令(。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|nvlmaker

GMT+8, 2024-3-29 01:09 , Processed in 0.011429 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表