textstyle标签说明—krpano教程

领主 krpano标签 0 喜欢 (1)

textstyle标签:当layer或hotspot插入文本插件后,可以使用textstyle标签来提取复用的文本属性样式。与style通用全部标签不一样,textstyle标签专用于文本相关的属性样式。同时也多运用于showtext插件显示文本样式的定义。

属性名称 变量全称 类型 默认值
name textstyle[name].name String
textstyle样式的名称.使用DEFAULT作为名称的话,将会复写掉系统默认的样式.
属性名称 变量全称 类型 默认值

origin 

edge 

xoffset 

yoffset

textstyle[name].origin 

textstyle[name].edge 

textstyle[name].xoffset 

textstyle[name].yoffset

String 

String 

int 

int

"cursor"

 "bottom" 

-3

定义文本位置的属性:

  • cursor - 跟随鼠标位置显示
  • lefttop, left, leftbottom, top, center, bottom, righttop, right, rightbottom - 显示文字在屏幕的不同对齐位置.

边缘对齐设定:

  • lefttop, left, leftbottom, top, center, bottom, righttop, right, rightbottom - 边缘对齐设定,这个与layer对齐方式一致.

xoffset and yoffset 设置x轴和Y轴的偏移量.

属性名称 变量全称 类型 默认值

fadeintime 

showtime 

fadetime

textstyle[name].fadeintime 

textstyle[name].showtime 

textstyle[name].fadetime

Number 

Number 

Number

0.0 

0.1 

0.0

文本显示时间,秒数:

  • fadeintime - 渐入时间.
  • showtime - 显示持续时间.
  • fadetime - 渐出时间.
属性名称 变量全称 类型 默认值

font 

fontsize 

bold 

italic

textstyle[name].font 

textstyle[name].fontsize 

textstyle[name].bold 

textstyle[name].italic

String 

Number 

Boolean 

Boolean

"Times" 

12.0 

true 

false

  • font - 字体.
  • fontsize - 文字大小.
  • bold - 是否设置粗体,默认true.
  • italic - 斜体.
属性名称 变量全称 类型 默认值
textcolor textstyle[name].textcolor int 0x000000
设置文本颜色.
属性名称 变量全称 类型 默认值
textalign textstyle[name].textalign String "none"
文本对齐方式: none, left, center, right.
属性名称 变量全称 类型 默认值
padding textstyle[name].padding String "2"
内边距填充值:

    • 一、padding="25”
    • 四个边均填充25px
    • 二、padding="25 50"
    • 顶部和底部填充25px
    • 右边和左边填充50px
    • 三、padding="25 50 75"
    • 顶部填充25px
    • 右边和坐标填充50px
    • 底部填充75px
    • 四、padding="25 50 75 100"
    • 顶部填充25px
    • 右边填充50px
    • 底部填充75px
    • 左边填充100px
属性名称 变量全称 类型 默认值
css textstyle[name].css String ""
  • 增加自定义CSS到文本中.
  • 只支持有些子集的CSS.
  •  Flashplayer支持CSS的地址: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StyleSheet.html
  • 设置文字大小是记得添加 'px',否则设置无效.
属性名称 变量全称 类型 默认值

width 

height 

vcenter

textstyle[name].width 

textstyle[name].height 

textstyle[name].vcenter

String 

String 

Boolean

"" 

"" 

false

调整文本区域大小. 默认大小是以文字大小为基准. vcenter - 是否给定居中文本高度.
属性名称 变量全称 类型 默认值

background 

backgroundcolor 

backgroundalpha

textstyle[name].background 

textstyle[name].backgroundcolor 

textstyle[name].backgroundalpha

Boolean 

int 

Number

true

0xFFFFFF 

1.0

  • background - 是否绘制一个背景颜色.
  • backgroundcolor - 当前背景颜色,默认白色.
  • backgroundalpha - 背景透明度.
属性名称 变量全称 类型 默认值

border 

bordercolor 

borderalpha 

borderwidth

textstyle[name].border 

textstyle[name].bordercolor 

textstyle[name].borderalpha 

textstyle[name].borderwidth

Boolean 

int 

Number 

Number

false 

0x000000 

1.0 

1.0

  • border  - 是否绘制文本区域边框.
  • bordercolor - 边框颜色.
  • borderalpha - 边框透明度.
  • borderwidth - 边框宽度,居外.
属性名称 变量全称 类型 默认值
roundedge textstyle[name].roundedge Number 0.0
  • 设置边界圆角率.
属性名称 变量全称 类型 默认值

shadow 

shadowrange 

shadowangle 

shadowcolor 

shadowalpha

textstyle[name].shadow 

textstyle[name].shadowrange 

textstyle[name].shadowangle 

textstyle[name].shadowcolor 

textstyle[name].shadowalpha

Number 

Number 

Number 

int 

Number

0.0 

4.0 

45.0 

0x000000 

1.0

文本区域阴影设置.

  • shadow - 阴影距离. 当设置 'centered shadow' 或 'glowing effects'时,使用0.01.
  • shadowrange - 设置阴影模糊范围.
  • shadowangle - 阴影偏移角度.
  • shadowcolor - 阴影颜色.
  • shadowalpha - 阴影透明度.
属性名称 变量全称 类型 默认值

textshadow 

textshadowrange 

textshadowangle 

textshadowcolor textshadowalpha

textstyle[name].textshadow 

textstyle[name].textshadowrange 

textstyle[name].textshadowangle 

textstyle[name].textshadowcolor 

textstyle[name].textshadowalpha

Number 

Number 

Number 

int 

Number

0.0 

4.0 

45.0 

0x000000 

1.0

设置文字阴影.

  • textshadow - 文字阴影距离. 当设置 'centered shadow' 或 'glowing effects'时,使用0.01.
  • textshadowrange - 设置阴影模糊范围.
  • textshadowangle - 阴影偏移角度.
  • textshadowcolor - 阴影颜色.
  • textshadowalpha - 阴影透明度.
属性名称 变量全称 类型 默认值
alpha textstyle[name].alpha Number 1.0
文本区域透明度 (0.0 - 1.0).
属性名称 变量全称 类型 默认值
parent textstyle[name].parent String
设置父layer:

  • 与普通Layer的parent属性一致.
属性名称 变量全称 类型 默认值
noclip textstyle[name].noclip Boolean true
是否避免在屏幕边框上剪贴.

  
layer调用样例:

showtext调用样例:

 

 



㊣ 凡未注明来源或投稿方的文章,皆为本站原创或原译作品,转载前须经本站同意,并在转载时注明来自  域图新视界  victu360.com,否则将追究相关法律责任。
本文标题:《textstyle标签说明—krpano教程》

喜欢 1 发布评论
发表评论

您必须 [ 登录 ] 才能发表留言!

Top