krpano之缩略图文本添加
Posted 莫小龙
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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>
以上是关于krpano之缩略图文本添加的主要内容,如果未能解决你的问题,请参考以下文章