我是靠谱客的博主 正直彩虹,最近开发中收集的这篇文章主要介绍krpano之缩略图文本添加,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

效果:

  在缩略图上添加文本,显示缩略图名称。

方法:将皮肤中的 skin_addthumbs 方法替换为一下代码。

 <action name="skin_addthumbs">
        if(skin_settings.thumbs == false,
        set(layer[skin_btn_thumbs].visible,false);
        ,
        copy(thumbwidth, skin_settings.thumbs_width);
        copy(thumbheight, skin_settings.thumbs_height);
        copy(thumbpadding, skin_settings.thumbs_padding);
        copy(thumbcrop, skin_settings.thumbs_crop);

        add(thumbxoffset, thumbwidth, thumbpadding);
        mul(thumbxcenter, thumbxoffset, 0.5);
        mul(thumbbarwidth, thumbxoffset, scene.count);
        add(thumbbarwidth, thumbpadding);
        add(thumbbarheight, thumbpadding, thumbheight);
        add(thumbbarheight, thumbpadding);

        if(skin_settings.thumbs_scrollindicator,
        copy(layer[skin_thumbs_scrollindicator].y, thumbbarheight);
        add(thumbbarheight, layer[skin_thumbs_scrollindicator].height);
        );

        copy(layer[skin_thumbs].height, thumbbarheight);
        copy(layer[skin_thumbs].width, thumbbarwidth);

        mul(halfheight, thumbbarheight, 0.5);
        copy(layer[skin_thumbs_scrollleft].y, halfheight);
        copy(layer[skin_thumbs_scrollright].y, halfheight);

        set(thumb_cnt,0);
        for(set(i,0), i LT scene.count, inc(i),
        txtadd(thumbname,'skin_thumb_',get(i));
        addlayer(get(thumbname));
        copy(layer[get(thumbname)].url, scene[get(i)].thumburl);
        set(layer[get(thumbname)].keep, true);
        set(layer[get(thumbname)].parent, 'skin_thumbs');
        set(layer[get(thumbname)].align, lefttop);
        copy(layer[get(thumbname)].crop, thumbcrop);
        copy(layer[get(thumbname)].width, thumbwidth);
        copy(layer[get(thumbname)].height, thumbheight);
        mul(thumbx, i, thumbxoffset);
        add(thumbx, thumbpadding);
        copy(layer[get(thumbname)].x, thumbx);
        copy(layer[get(thumbname)].y, thumbpadding);
        add(scene[get(i)].thumbx, thumbx, thumbxcenter);
        copy(scene[get(i)].thumby, thumbpadding);
        set(layer[get(thumbname)].linkedscene, get(scene[get(i)].name) );
        set(layer[get(thumbname)].onclick, copy(layer[skin_thumbborder].parent, name); loadscene(get(linkedscene),null,get(skin_settings.loadscene_flags),get(skin_settings.loadscene_blend)); );
        if(skin_settings.tooltips_thumbs,
        set(layer[get(thumbname)].tooltip, get(scene[get(i)].title) );
        layer[get(thumbname)].loadstyle(skin_tooltips);
        );
        <!--  if(skin_settings.thumbs_text,
            txtadd(thumbtext, 'skin_thumbtext_', get(i));
            addlayer(get(thumbtext));
            layer[get(thumbtext)].loadstyle(skin_thumbtext_style);
            set(layer[get(thumbtext)].keep, true);
            set(layer[get(thumbtext)].parent, get(thumbname));
            set(layer[get(thumbtext)].html, get(scene[get(i)].title));
          ); -->
        <!--START:缩略图标题-->
        <!--添加场景标题文字背景层-->
        txtadd(thumbtitlbackename,'skin_thumb_title_back',get(i));
        addlayer(get(thumbtitlbackename));
        copy(layer[get(thumbtitlbackename)].parent, thumbname);
        copy(layer[get(thumbtitlbackename)].width, thumbwidth);
        set(layer[get(thumbtitlbackename)].height, 20);
        copy(layer[get(thumbtitlbackename)].x, 0);
        copy(layer[get(thumbtitlbackename)].y, 30);
        set(layer[get(thumbtitlbackename)].align, "bottom");
        set(layer[get(thumbtitlbackename)].keep, true);
        set(layer[get(thumbtitlbackename)].type, "container");
        set(layer[get(thumbtitlbackename)].bgcolor, "0x000000");
        set(layer[get(thumbtitlbackename)].zorder, 50);
        set(layer[get(thumbtitlbackename)].bgalpha, "0.3");
        <!--添加标题文字层-->
        <!--缩略图上的标题信息删除本段就不在显示了-->
        if(skin_settings.tooltips_thumbs,
        set(layer[get(thumbname)].onhover, showtext(get(scene[get(linkedscene)].title),SKIN_TOOLTIPS); );
        );
        <!-- 添加标题文字层 -->
        txtadd(thumbtitlname,'skin_thumb_title',get(i)); addlayer(get(thumbtitlname)); copy(layer[get(thumbtitlname)].parent, thumbtitlbackename); set(layer[get(thumbtitlname)].url, "%SWFPATH%/plugins/textfield.swf"); set(layer[get(thumbtitlname)].align, "center"); set(layer[get(thumbtitlname)].keep, true); copy(layer[get(thumbtitlname)].html, scene[get(i)].title); set(layer[get(thumbtitlname)].zorder, 51); set(layer[get(thumbtitlname)].visible, "true"); set(layer[get(thumbtitlname)].autoheight, "true"); set(layer[get(thumbtitlname)].background, "false"); set(layer[get(thumbtitlname)].border, "false"); set(layer[get(thumbtitlname)].enabled, "true"); set(layer[get(thumbtitlname)].css,"text-align:center; color:#ffffff; font-family:Arial; font-weight:bold; font-size:19px; "); set(layer[get(thumbtitlname)].textshadow, 2);
        <!-- END:缩略图标题 -->

        );
        );

    </action>

 

转载于:https://www.cnblogs.com/s313139232/p/7380981.html

最后

以上就是正直彩虹为你收集整理的krpano之缩略图文本添加的全部内容,希望文章能够帮你解决krpano之缩略图文本添加所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(42)

评论列表共有 0 条评论

立即
投稿
返回
顶部