跳到主要内容

获取节点中心位置 (:GetCenterPoint)

函数

节点中心横坐标, 节点中心纵坐标 =  节点信息:GetCenterPoint()

返回值

  • 节点中心横坐标

  • 节点中心纵坐标

说明

获取节点信息的 中心坐标

示例

  local node = require("nodeLua")

local nodeInfo = node.byPath('AWEMaskWindow/UITransitionView/UIDropShadowView/UILayoutContainerView/UITransitionView/UIViewControllerWrapperView/UILayoutContainerView/UINavigationTransitionView/UIViewControllerWrapperView/UIView/UIView/AWESearchCachalotView/CachalotCollectionView/CachalotCommonCollectionViewCell/UIView/SearchDynamicContainerView/BDXView/BDXLynxView/LynxView/LynxScrollView/UILynxView/UILynxView/UILynxView/LynxTextView/')
--查找路径


if (nodeInfo) then
print(nodeInfo[1]:GetCenterPoint()) --打印节点当前 中心位置
end