绝对位置计算 Abs Plugin

简述

  • 无论层的父元素是哪一个,无论如何设置该层的对齐、边缘、缩放和宽高,都能找出该层相当于屏幕的绝对位置。
  • scrollarea插件共同工作。
  • 该插件包含在Tooltip以及Auto Thumbs两个插件的下载包中。

语法及xml使用方法

在你的主xml文件中嵌入xml文件:

语法使用

插件动作

动作名

get_x(destination, layer_name, origin*)
get_y(destination, layer_name, origin*)
计算层的绝对x/y坐标,将这个数值复制到destination变量中。参数:destination目标变量。如果变量不存在则生成。layer_name层的名字。

origin(可选)

你设置的坐标原点。

get_x可设置的值:left,center,right。默认为left。

get_y可设置的值:top,center,bottom。默认为top。

动作名

get_width(destination, layer_name)
get_height(destination, layer_name)
计算层的绝对宽度width与高度height,将这个数值复制到destination变量中。参数:destination目标变量。如果变量不存在则生成。layer_name层的名字。

动作名

get_scale(destination, layer_name)
计算层的绝对缩放值scale,将这个数值复制到destination变量中。参数:destination目标变量。如果变量不存在则生成。layer_name层的名字。

源代码及插件下载

因为该插件实际上与krpano官方动作layertoscreen功能重叠,因此该插件免费下载并提供了源代码。

链接:http://pan.baidu.com/s/1sjBpvmX 密码:6iuu

发表评论